@carlonicora/nextjs-jsonapi 1.129.1 → 1.130.0
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/{BlockNoteEditor-RG2YQDMQ.js → BlockNoteEditor-AI5C4PBZ.js} +11 -11
- package/dist/BlockNoteEditor-AI5C4PBZ.js.map +1 -0
- package/dist/{BlockNoteEditor-WIAQJ5HM.mjs → BlockNoteEditor-KARBUMFE.mjs} +4 -4
- package/dist/BlockNoteEditor-KARBUMFE.mjs.map +1 -0
- package/dist/billing/index.js +398 -389
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +131 -122
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-YQTMNZQB.js → chunk-BHZVFSDR.js} +158 -89
- package/dist/chunk-BHZVFSDR.js.map +1 -0
- package/dist/{chunk-F54XZKPY.mjs → chunk-NXHNJCY2.mjs} +2119 -2050
- package/dist/chunk-NXHNJCY2.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +20 -2
- package/dist/components/index.d.ts +20 -2
- package/dist/components/index.js +8 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +7 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +32 -31
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +3 -2
- package/dist/features/help/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/containers/ReactMarkdownContainer.tsx +2 -2
- package/src/components/editors/BlockNoteDiffInlineContent.tsx +10 -10
- package/src/components/editors/BlockNoteEditor.tsx +2 -2
- package/src/components/forms/FormCheckbox.tsx +2 -2
- package/src/components/forms/FormFieldWrapper.tsx +1 -1
- package/src/components/forms/FormSlider.tsx +1 -1
- package/src/components/forms/GdprConsentCheckbox.tsx +1 -1
- package/src/components/hero/EntitySection.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/typography/DetailField.tsx +35 -0
- package/src/components/typography/MicroLabel.tsx +21 -0
- package/src/components/typography/SectionHeader.tsx +18 -0
- package/src/components/typography/index.ts +6 -0
- package/src/features/assistant/components/parts/AssistantEmptyState.tsx +2 -1
- package/src/features/assistant/components/parts/AssistantSidebar.tsx +2 -1
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +1 -1
- package/src/features/auth/components/forms/Register.tsx +1 -1
- package/src/features/auth/components/forms/TwoFactorChallenge.tsx +3 -3
- package/src/features/auth/components/two-factor/BackupCodesDialog.tsx +1 -1
- package/src/features/auth/components/two-factor/TotpInput.tsx +2 -2
- package/src/features/auth/components/two-factor/TwoFactorSettings.tsx +3 -3
- package/src/features/billing/components/cards/BillingUsageSummaryCard.tsx +4 -4
- package/src/features/billing/components/cards/CustomerInfoCard.tsx +6 -6
- package/src/features/billing/components/cards/InvoicesSummaryCard.tsx +5 -5
- package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +4 -4
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +4 -4
- package/src/features/billing/components/containers/BillingDashboardContainer.tsx +2 -2
- package/src/features/billing/components/widgets/BillingAlertBanner.tsx +8 -8
- package/src/features/billing/stripe-customer/components/containers/PaymentMethodsContainer.tsx +2 -2
- package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +8 -2
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +1 -1
- package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +16 -18
- package/src/features/billing/stripe-invoice/components/lists/InvoicesList.tsx +2 -2
- package/src/features/billing/stripe-invoice/components/widgets/InvoiceStatusBadge.tsx +8 -7
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +6 -13
- package/src/features/billing/stripe-product/components/containers/ProductsAdminContainer.tsx +3 -3
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +4 -7
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +6 -6
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +2 -2
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +10 -10
- package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +2 -2
- package/src/features/billing/stripe-subscription/components/widgets/ProductPricingRow.tsx +2 -1
- package/src/features/billing/stripe-subscription/components/widgets/ProrationPreview.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/widgets/SubscriptionStatusBadge.tsx +12 -11
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +2 -1
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +10 -13
- package/src/features/billing/stripe-usage/components/containers/UsageContainer.tsx +2 -2
- package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +6 -6
- package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +3 -2
- package/src/features/company/components/details/CompanyContent.tsx +4 -7
- package/src/features/company/components/details/TokenStatusIndicator.tsx +5 -5
- package/src/features/company/components/forms/CompanyDeleter.tsx +1 -1
- package/src/features/company/components/forms/CompanyEditor.tsx +3 -2
- package/src/features/content/components/lists/ContentsList.tsx +2 -1
- package/src/features/feature/components/forms/FormFeatures.tsx +6 -1
- package/src/features/help/components/HelpTOC.tsx +2 -3
- package/src/features/how-to/components/containers/HowToCommand.tsx +3 -3
- package/src/features/how-to/components/containers/HowToCommandViewer.tsx +4 -1
- package/src/features/notification/components/containers/NotificationsListContainer.tsx +1 -1
- package/src/features/notification/components/modals/NotificationModal.tsx +2 -2
- package/src/features/oauth/components/OAuthClientCard.tsx +1 -1
- package/src/features/oauth/components/OAuthClientDetail.tsx +5 -9
- package/src/features/oauth/components/OAuthClientForm.tsx +3 -3
- package/src/features/oauth/components/OAuthClientList.tsx +5 -4
- package/src/features/oauth/components/OAuthClientSecretDisplay.tsx +3 -3
- package/src/features/oauth/components/OAuthRedirectUriInput.tsx +1 -1
- package/src/features/oauth/components/OAuthScopeSelector.tsx +2 -2
- package/src/features/oauth/components/consent/OAuthConsentHeader.tsx +1 -1
- package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +1 -1
- package/src/features/oauth/components/consent/OAuthScopeList.tsx +2 -3
- package/src/features/rbac/components/RbacContainer.tsx +1 -1
- package/src/features/rbac/components/RbacPermissionCell.tsx +2 -2
- package/src/features/rbac/components/RbacPermissionPicker.tsx +3 -3
- package/src/features/referral/components/ReferralWidget.tsx +7 -6
- package/src/features/waitlist/components/forms/WaitlistForm.tsx +3 -2
- package/src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx +1 -1
- package/src/features/waitlist/components/lists/WaitlistList.tsx +2 -1
- package/src/features/waitlist/components/sections/WaitlistConfirmation.tsx +3 -2
- package/src/features/waitlist/components/sections/WaitlistSuccessState.tsx +2 -1
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +1 -1
- package/src/shadcnui/custom/link.tsx +7 -1
- package/src/shadcnui/ui/alert.tsx +1 -1
- package/src/shadcnui/ui/badge.tsx +7 -0
- package/src/shadcnui/ui/button.tsx +1 -1
- package/src/shadcnui/ui/chart.tsx +1 -3
- package/dist/BlockNoteEditor-RG2YQDMQ.js.map +0 -1
- package/dist/BlockNoteEditor-WIAQJ5HM.mjs.map +0 -1
- package/dist/chunk-F54XZKPY.mjs.map +0 -1
- package/dist/chunk-YQTMNZQB.js.map +0 -1
package/dist/billing/index.mjs
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
FormTextarea,
|
|
37
37
|
Input,
|
|
38
38
|
Label,
|
|
39
|
+
SectionHeader,
|
|
39
40
|
Skeleton,
|
|
40
41
|
Table,
|
|
41
42
|
TableBody,
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
TabsList,
|
|
48
49
|
TabsTrigger,
|
|
49
50
|
useCurrentUserContext
|
|
50
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-NXHNJCY2.mjs";
|
|
51
52
|
import {
|
|
52
53
|
getRoleId,
|
|
53
54
|
getStripePublishableKey
|
|
@@ -115,7 +116,7 @@ function SubscriptionSummaryCard({
|
|
|
115
116
|
if (loading) {
|
|
116
117
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
117
118
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
118
|
-
/* @__PURE__ */ jsx(CardTitle, {
|
|
119
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "Subscriptions" }),
|
|
119
120
|
/* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
120
121
|
] }),
|
|
121
122
|
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
@@ -128,10 +129,10 @@ function SubscriptionSummaryCard({
|
|
|
128
129
|
if (error) {
|
|
129
130
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
130
131
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
131
|
-
/* @__PURE__ */ jsx(CardTitle, {
|
|
132
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "Subscriptions" }),
|
|
132
133
|
/* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
133
134
|
] }),
|
|
134
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("p", { className: "text-
|
|
135
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
135
136
|
] });
|
|
136
137
|
}
|
|
137
138
|
const activeSubscriptions = subscriptions.filter(
|
|
@@ -140,7 +141,7 @@ function SubscriptionSummaryCard({
|
|
|
140
141
|
const primarySubscription = activeSubscriptions[0];
|
|
141
142
|
return /* @__PURE__ */ jsxs(Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
142
143
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
143
|
-
/* @__PURE__ */ jsx(CardTitle, {
|
|
144
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "Subscriptions" }),
|
|
144
145
|
/* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
145
146
|
] }),
|
|
146
147
|
/* @__PURE__ */ jsx(CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -210,7 +211,7 @@ function PaymentMethodSummaryCard({
|
|
|
210
211
|
if (loading) {
|
|
211
212
|
return /* @__PURE__ */ jsxs2(Card, { children: [
|
|
212
213
|
/* @__PURE__ */ jsxs2(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
213
|
-
/* @__PURE__ */ jsx2(CardTitle, {
|
|
214
|
+
/* @__PURE__ */ jsx2(CardTitle, { children: "Payment Method" }),
|
|
214
215
|
/* @__PURE__ */ jsx2(Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
215
216
|
] }),
|
|
216
217
|
/* @__PURE__ */ jsxs2(CardContent, { children: [
|
|
@@ -222,16 +223,16 @@ function PaymentMethodSummaryCard({
|
|
|
222
223
|
if (error) {
|
|
223
224
|
return /* @__PURE__ */ jsxs2(Card, { children: [
|
|
224
225
|
/* @__PURE__ */ jsxs2(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
225
|
-
/* @__PURE__ */ jsx2(CardTitle, {
|
|
226
|
+
/* @__PURE__ */ jsx2(CardTitle, { children: "Payment Method" }),
|
|
226
227
|
/* @__PURE__ */ jsx2(Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
227
228
|
] }),
|
|
228
|
-
/* @__PURE__ */ jsx2(CardContent, { children: /* @__PURE__ */ jsx2("p", { className: "text-
|
|
229
|
+
/* @__PURE__ */ jsx2(CardContent, { children: /* @__PURE__ */ jsx2("p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
229
230
|
] });
|
|
230
231
|
}
|
|
231
232
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
232
233
|
return /* @__PURE__ */ jsxs2(Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
233
234
|
/* @__PURE__ */ jsxs2(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
234
|
-
/* @__PURE__ */ jsx2(CardTitle, {
|
|
235
|
+
/* @__PURE__ */ jsx2(CardTitle, { children: "Payment Method" }),
|
|
235
236
|
/* @__PURE__ */ jsx2(Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
236
237
|
] }),
|
|
237
238
|
/* @__PURE__ */ jsx2(CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
|
|
@@ -313,7 +314,7 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
313
314
|
if (loading) {
|
|
314
315
|
return /* @__PURE__ */ jsxs3(Card, { children: [
|
|
315
316
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
316
|
-
/* @__PURE__ */ jsx3(CardTitle, {
|
|
317
|
+
/* @__PURE__ */ jsx3(CardTitle, { children: "Billing Account" }),
|
|
317
318
|
/* @__PURE__ */ jsx3(User, { className: "h-4 w-4 text-muted-foreground" })
|
|
318
319
|
] }),
|
|
319
320
|
/* @__PURE__ */ jsxs3(CardContent, { children: [
|
|
@@ -326,16 +327,16 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
326
327
|
if (error) {
|
|
327
328
|
return /* @__PURE__ */ jsxs3(Card, { children: [
|
|
328
329
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
329
|
-
/* @__PURE__ */ jsx3(CardTitle, {
|
|
330
|
+
/* @__PURE__ */ jsx3(CardTitle, { children: "Billing Account" }),
|
|
330
331
|
/* @__PURE__ */ jsx3(User, { className: "h-4 w-4 text-muted-foreground" })
|
|
331
332
|
] }),
|
|
332
|
-
/* @__PURE__ */ jsx3(CardContent, { children: /* @__PURE__ */ jsx3("p", { className: "text-
|
|
333
|
+
/* @__PURE__ */ jsx3(CardContent, { children: /* @__PURE__ */ jsx3("p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
333
334
|
] });
|
|
334
335
|
}
|
|
335
336
|
if (!customer) {
|
|
336
337
|
return /* @__PURE__ */ jsxs3(Card, { children: [
|
|
337
338
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
338
|
-
/* @__PURE__ */ jsx3(CardTitle, {
|
|
339
|
+
/* @__PURE__ */ jsx3(CardTitle, { children: "Billing Account" }),
|
|
339
340
|
/* @__PURE__ */ jsx3(User, { className: "h-4 w-4 text-muted-foreground" })
|
|
340
341
|
] }),
|
|
341
342
|
/* @__PURE__ */ jsxs3(CardContent, { children: [
|
|
@@ -346,7 +347,7 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
346
347
|
}
|
|
347
348
|
return /* @__PURE__ */ jsxs3(Card, { children: [
|
|
348
349
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
349
|
-
/* @__PURE__ */ jsx3(CardTitle, {
|
|
350
|
+
/* @__PURE__ */ jsx3(CardTitle, { children: "Billing Account" }),
|
|
350
351
|
/* @__PURE__ */ jsx3(User, { className: "h-4 w-4 text-muted-foreground" })
|
|
351
352
|
] }),
|
|
352
353
|
/* @__PURE__ */ jsx3(CardContent, { children: /* @__PURE__ */ jsxs3("div", { className: "space-y-2", children: [
|
|
@@ -354,7 +355,7 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
354
355
|
customer.email && /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
355
356
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ jsxs3("p", { className: "text-sm", children: [
|
|
356
357
|
/* @__PURE__ */ jsx3("span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
357
|
-
/* @__PURE__ */ jsx3("span", { className: customer.balance < 0 ? "text-
|
|
358
|
+
/* @__PURE__ */ jsx3("span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
358
359
|
] }),
|
|
359
360
|
/* @__PURE__ */ jsxs3(Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
360
361
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
@@ -402,7 +403,7 @@ function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
|
402
403
|
if (loading) {
|
|
403
404
|
return /* @__PURE__ */ jsxs4(Card, { children: [
|
|
404
405
|
/* @__PURE__ */ jsxs4(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
405
|
-
/* @__PURE__ */ jsx4(CardTitle, {
|
|
406
|
+
/* @__PURE__ */ jsx4(CardTitle, { children: "Recent Invoices" }),
|
|
406
407
|
/* @__PURE__ */ jsx4(ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
407
408
|
] }),
|
|
408
409
|
/* @__PURE__ */ jsxs4(CardContent, { children: [
|
|
@@ -415,10 +416,10 @@ function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
|
415
416
|
if (error) {
|
|
416
417
|
return /* @__PURE__ */ jsxs4(Card, { children: [
|
|
417
418
|
/* @__PURE__ */ jsxs4(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
418
|
-
/* @__PURE__ */ jsx4(CardTitle, {
|
|
419
|
+
/* @__PURE__ */ jsx4(CardTitle, { children: "Recent Invoices" }),
|
|
419
420
|
/* @__PURE__ */ jsx4(ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
420
421
|
] }),
|
|
421
|
-
/* @__PURE__ */ jsx4(CardContent, { children: /* @__PURE__ */ jsx4("p", { className: "text-
|
|
422
|
+
/* @__PURE__ */ jsx4(CardContent, { children: /* @__PURE__ */ jsx4("p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
422
423
|
] });
|
|
423
424
|
}
|
|
424
425
|
const latestInvoice = invoices[0];
|
|
@@ -426,7 +427,7 @@ function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
|
426
427
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
427
428
|
return /* @__PURE__ */ jsxs4(Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
428
429
|
/* @__PURE__ */ jsxs4(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
429
|
-
/* @__PURE__ */ jsx4(CardTitle, {
|
|
430
|
+
/* @__PURE__ */ jsx4(CardTitle, { children: "Recent Invoices" }),
|
|
430
431
|
/* @__PURE__ */ jsx4(ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
431
432
|
] }),
|
|
432
433
|
/* @__PURE__ */ jsx4(CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
@@ -443,7 +444,7 @@ function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
|
443
444
|
paidInvoices.length,
|
|
444
445
|
" paid"
|
|
445
446
|
] }),
|
|
446
|
-
openInvoices.length > 0 && /* @__PURE__ */ jsxs4("span", { className: "text-
|
|
447
|
+
openInvoices.length > 0 && /* @__PURE__ */ jsxs4("span", { className: "text-warning", children: [
|
|
447
448
|
openInvoices.length,
|
|
448
449
|
" open"
|
|
449
450
|
] }),
|
|
@@ -477,7 +478,7 @@ function BillingUsageSummaryCard({
|
|
|
477
478
|
if (loading) {
|
|
478
479
|
return /* @__PURE__ */ jsxs5(Card, { children: [
|
|
479
480
|
/* @__PURE__ */ jsxs5(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
480
|
-
/* @__PURE__ */ jsx5(CardTitle, {
|
|
481
|
+
/* @__PURE__ */ jsx5(CardTitle, { children: "Usage This Month" }),
|
|
481
482
|
/* @__PURE__ */ jsx5(Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
482
483
|
] }),
|
|
483
484
|
/* @__PURE__ */ jsxs5(CardContent, { children: [
|
|
@@ -489,10 +490,10 @@ function BillingUsageSummaryCard({
|
|
|
489
490
|
if (error) {
|
|
490
491
|
return /* @__PURE__ */ jsxs5(Card, { children: [
|
|
491
492
|
/* @__PURE__ */ jsxs5(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
492
|
-
/* @__PURE__ */ jsx5(CardTitle, {
|
|
493
|
+
/* @__PURE__ */ jsx5(CardTitle, { children: "Usage This Month" }),
|
|
493
494
|
/* @__PURE__ */ jsx5(Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
494
495
|
] }),
|
|
495
|
-
/* @__PURE__ */ jsx5(CardContent, { children: /* @__PURE__ */ jsx5("p", { className: "text-
|
|
496
|
+
/* @__PURE__ */ jsx5(CardContent, { children: /* @__PURE__ */ jsx5("p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
496
497
|
] });
|
|
497
498
|
}
|
|
498
499
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -502,7 +503,7 @@ function BillingUsageSummaryCard({
|
|
|
502
503
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
503
504
|
return /* @__PURE__ */ jsxs5(Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
504
505
|
/* @__PURE__ */ jsxs5(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
505
|
-
/* @__PURE__ */ jsx5(CardTitle, {
|
|
506
|
+
/* @__PURE__ */ jsx5(CardTitle, { children: "Usage This Month" }),
|
|
506
507
|
/* @__PURE__ */ jsx5(Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
507
508
|
] }),
|
|
508
509
|
/* @__PURE__ */ jsx5(CardContent, { children: meters.length === 0 ? /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
@@ -635,7 +636,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
635
636
|
) }),
|
|
636
637
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-2", children: [
|
|
637
638
|
/* @__PURE__ */ jsx6(Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
638
|
-
/* @__PURE__ */ jsx6(Label, { htmlFor: "setAsDefault", className: "
|
|
639
|
+
/* @__PURE__ */ jsx6(Label, { htmlFor: "setAsDefault", className: "font-normal", children: "Set as default payment method" })
|
|
639
640
|
] }),
|
|
640
641
|
error && /* @__PURE__ */ jsx6(Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ jsx6(AlertDescription, { children: error }) }),
|
|
641
642
|
/* @__PURE__ */ jsxs6("div", { className: "flex justify-end gap-x-2", children: [
|
|
@@ -721,7 +722,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
721
722
|
}, "handleRemove");
|
|
722
723
|
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
723
724
|
/* @__PURE__ */ jsxs8(Card, { className: "relative", children: [
|
|
724
|
-
isDefault && /* @__PURE__ */ jsx8(Badge, { className: "absolute right-2 top-2
|
|
725
|
+
isDefault && /* @__PURE__ */ jsx8(Badge, { variant: "softGreen", className: "absolute right-2 top-2", children: "Default" }),
|
|
725
726
|
/* @__PURE__ */ jsxs8(CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
726
727
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-2", children: [
|
|
727
728
|
/* @__PURE__ */ jsx8("span", { className: "text-2xl", children: brandIcon }),
|
|
@@ -742,7 +743,15 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
742
743
|
) }),
|
|
743
744
|
/* @__PURE__ */ jsxs8(DropdownMenuContent, { align: "end", children: [
|
|
744
745
|
!isDefault && /* @__PURE__ */ jsx8(DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
745
|
-
/* @__PURE__ */ jsx8(
|
|
746
|
+
/* @__PURE__ */ jsx8(
|
|
747
|
+
DropdownMenuItem,
|
|
748
|
+
{
|
|
749
|
+
onClick: () => setShowRemoveDialog(true),
|
|
750
|
+
disabled: loading,
|
|
751
|
+
className: "text-destructive",
|
|
752
|
+
children: "Remove"
|
|
753
|
+
}
|
|
754
|
+
)
|
|
746
755
|
] })
|
|
747
756
|
] })
|
|
748
757
|
] }),
|
|
@@ -810,14 +819,14 @@ function PaymentMethodsContainer() {
|
|
|
810
819
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between", children: [
|
|
811
820
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-3", children: [
|
|
812
821
|
/* @__PURE__ */ jsx10(CreditCard2, { className: "h-8 w-8" }),
|
|
813
|
-
/* @__PURE__ */ jsx10("h1", { className: "text-3xl font-
|
|
822
|
+
/* @__PURE__ */ jsx10("h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
814
823
|
] }),
|
|
815
824
|
/* @__PURE__ */ jsx10(Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
816
825
|
] }),
|
|
817
826
|
paymentMethods.length === 0 && /* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 bg-muted/50 p-12", children: [
|
|
818
827
|
/* @__PURE__ */ jsx10(CreditCard2, { className: "h-16 w-16 text-muted-foreground" }),
|
|
819
828
|
/* @__PURE__ */ jsxs9("div", { className: "text-center", children: [
|
|
820
|
-
/* @__PURE__ */ jsx10("h3", { className: "mb-2 text-
|
|
829
|
+
/* @__PURE__ */ jsx10("h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
821
830
|
/* @__PURE__ */ jsx10("p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
822
831
|
/* @__PURE__ */ jsx10(Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
823
832
|
] })
|
|
@@ -896,28 +905,28 @@ import { jsx as jsx11 } from "react/jsx-runtime";
|
|
|
896
905
|
var statusConfig = {
|
|
897
906
|
["draft" /* DRAFT */]: {
|
|
898
907
|
label: "Draft",
|
|
899
|
-
|
|
908
|
+
variant: "softGray"
|
|
900
909
|
},
|
|
901
910
|
["open" /* OPEN */]: {
|
|
902
911
|
label: "Open",
|
|
903
|
-
|
|
912
|
+
variant: "softBlue"
|
|
904
913
|
},
|
|
905
914
|
["paid" /* PAID */]: {
|
|
906
915
|
label: "Paid",
|
|
907
|
-
|
|
916
|
+
variant: "softGreen"
|
|
908
917
|
},
|
|
909
918
|
["void" /* VOID */]: {
|
|
910
919
|
label: "Void",
|
|
911
|
-
|
|
920
|
+
variant: "softGray"
|
|
912
921
|
},
|
|
913
922
|
["uncollectible" /* UNCOLLECTIBLE */]: {
|
|
914
923
|
label: "Uncollectible",
|
|
915
|
-
|
|
924
|
+
variant: "softRed"
|
|
916
925
|
}
|
|
917
926
|
};
|
|
918
927
|
function InvoiceStatusBadge({ status }) {
|
|
919
928
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
920
|
-
return /* @__PURE__ */ jsx11(
|
|
929
|
+
return /* @__PURE__ */ jsx11(Badge, { variant: config.variant, children: config.label });
|
|
921
930
|
}
|
|
922
931
|
__name(InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
923
932
|
|
|
@@ -963,24 +972,24 @@ function InvoiceDetails({
|
|
|
963
972
|
] }),
|
|
964
973
|
/* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
965
974
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
966
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
967
|
-
/* @__PURE__ */ jsxs10("p", { className: "
|
|
975
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Billing Period:" }),
|
|
976
|
+
/* @__PURE__ */ jsxs10("p", { className: "text-sm", children: [
|
|
968
977
|
formatDate3(invoice.periodStart),
|
|
969
978
|
" - ",
|
|
970
979
|
formatDate3(invoice.periodEnd)
|
|
971
980
|
] })
|
|
972
981
|
] }),
|
|
973
982
|
invoice.dueDate && /* @__PURE__ */ jsxs10("div", { children: [
|
|
974
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
975
|
-
/* @__PURE__ */ jsx12("p", { className: "
|
|
983
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Due Date:" }),
|
|
984
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm", children: formatDate3(invoice.dueDate) })
|
|
976
985
|
] }),
|
|
977
986
|
invoice.paidAt && /* @__PURE__ */ jsxs10("div", { children: [
|
|
978
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
979
|
-
/* @__PURE__ */ jsx12("p", { className: "
|
|
987
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Paid Date:" }),
|
|
988
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm", children: formatDate3(invoice.paidAt) })
|
|
980
989
|
] }),
|
|
981
990
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
982
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
983
|
-
/* @__PURE__ */ jsx12("p", { className: "
|
|
991
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Attempt Count:" }),
|
|
992
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm", children: invoice.attemptCount })
|
|
984
993
|
] })
|
|
985
994
|
] }),
|
|
986
995
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
@@ -998,24 +1007,24 @@ function InvoiceDetails({
|
|
|
998
1007
|
] }),
|
|
999
1008
|
/* @__PURE__ */ jsxs10("div", { className: "space-y-2 border-t pt-4", children: [
|
|
1000
1009
|
/* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
|
|
1001
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
1002
|
-
/* @__PURE__ */ jsx12("span", { className: "
|
|
1010
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
1011
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm", children: formatCurrency(invoice.subtotal, invoice.currency) })
|
|
1003
1012
|
] }),
|
|
1004
1013
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
|
|
1005
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
1006
|
-
/* @__PURE__ */ jsx12("span", { className: "
|
|
1014
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1015
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm", children: formatCurrency(invoice.tax, invoice.currency) })
|
|
1007
1016
|
] }),
|
|
1008
1017
|
/* @__PURE__ */ jsxs10("div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1009
1018
|
/* @__PURE__ */ jsx12("span", { children: "Total:" }),
|
|
1010
1019
|
/* @__PURE__ */ jsx12("span", { children: formatCurrency(invoice.total, invoice.currency) })
|
|
1011
1020
|
] }),
|
|
1012
1021
|
invoice.amountPaid > 0 && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
|
|
1013
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
1014
|
-
/* @__PURE__ */ jsx12("span", { className: "
|
|
1022
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1023
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm text-success", children: formatCurrency(invoice.amountPaid, invoice.currency) })
|
|
1015
1024
|
] }),
|
|
1016
1025
|
invoice.amountRemaining > 0 && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
|
|
1017
|
-
/* @__PURE__ */ jsx12("span", { className: "text-
|
|
1018
|
-
/* @__PURE__ */ jsx12("span", { className: "
|
|
1026
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1027
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm text-destructive", children: formatCurrency(invoice.amountRemaining, invoice.currency) })
|
|
1019
1028
|
] })
|
|
1020
1029
|
] }),
|
|
1021
1030
|
/* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
@@ -1071,10 +1080,10 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1071
1080
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1072
1081
|
children: [
|
|
1073
1082
|
/* @__PURE__ */ jsx13(TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1074
|
-
/* @__PURE__ */ jsx13(TableCell, { className: "text-muted-foreground text-
|
|
1083
|
+
/* @__PURE__ */ jsx13(TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1075
1084
|
/* @__PURE__ */ jsx13(TableCell, { children: /* @__PURE__ */ jsx13(InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1076
1085
|
/* @__PURE__ */ jsx13(TableCell, { className: "text-right font-medium", children: amount }),
|
|
1077
|
-
/* @__PURE__ */ jsx13(TableCell, { className: "text-muted-foreground text-
|
|
1086
|
+
/* @__PURE__ */ jsx13(TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1078
1087
|
]
|
|
1079
1088
|
},
|
|
1080
1089
|
invoice.id
|
|
@@ -1223,44 +1232,44 @@ import { jsx as jsx16 } from "react/jsx-runtime";
|
|
|
1223
1232
|
var statusConfig2 = {
|
|
1224
1233
|
["active" /* ACTIVE */]: {
|
|
1225
1234
|
label: "Active",
|
|
1226
|
-
|
|
1235
|
+
variant: "softGreen"
|
|
1227
1236
|
},
|
|
1228
1237
|
["trialing" /* TRIALING */]: {
|
|
1229
1238
|
label: "Trial",
|
|
1230
|
-
|
|
1239
|
+
variant: "softBlue"
|
|
1231
1240
|
},
|
|
1232
1241
|
["past_due" /* PAST_DUE */]: {
|
|
1233
1242
|
label: "Past Due",
|
|
1234
|
-
|
|
1243
|
+
variant: "softRed"
|
|
1235
1244
|
},
|
|
1236
1245
|
["canceled" /* CANCELED */]: {
|
|
1237
1246
|
label: "Canceled",
|
|
1238
|
-
|
|
1247
|
+
variant: "softGray"
|
|
1239
1248
|
},
|
|
1240
1249
|
["paused" /* PAUSED */]: {
|
|
1241
1250
|
label: "Paused",
|
|
1242
|
-
|
|
1251
|
+
variant: "softYellow"
|
|
1243
1252
|
},
|
|
1244
1253
|
["unpaid" /* UNPAID */]: {
|
|
1245
1254
|
label: "Unpaid",
|
|
1246
|
-
|
|
1255
|
+
variant: "softOrange"
|
|
1247
1256
|
},
|
|
1248
1257
|
["incomplete" /* INCOMPLETE */]: {
|
|
1249
1258
|
label: "Incomplete",
|
|
1250
|
-
|
|
1259
|
+
variant: "softGray"
|
|
1251
1260
|
},
|
|
1252
1261
|
["incomplete_expired" /* INCOMPLETE_EXPIRED */]: {
|
|
1253
1262
|
label: "Expired",
|
|
1254
|
-
|
|
1263
|
+
variant: "softGray"
|
|
1255
1264
|
}
|
|
1256
1265
|
};
|
|
1257
1266
|
var cancelingConfig = {
|
|
1258
1267
|
label: "Canceling",
|
|
1259
|
-
|
|
1268
|
+
variant: "softAmber"
|
|
1260
1269
|
};
|
|
1261
1270
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1262
1271
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1263
|
-
return /* @__PURE__ */ jsx16(
|
|
1272
|
+
return /* @__PURE__ */ jsx16(Badge, { variant: config.variant, children: config.label });
|
|
1264
1273
|
}
|
|
1265
1274
|
__name(SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1266
1275
|
|
|
@@ -1340,7 +1349,7 @@ function SubscriptionDetails({
|
|
|
1340
1349
|
] }),
|
|
1341
1350
|
/* @__PURE__ */ jsxs14("div", { className: "space-y-6", children: [
|
|
1342
1351
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-x-3", children: [
|
|
1343
|
-
/* @__PURE__ */ jsx17("span", { className: "text-
|
|
1352
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground text-xs", children: "Status:" }),
|
|
1344
1353
|
/* @__PURE__ */ jsx17(
|
|
1345
1354
|
SubscriptionStatusBadge,
|
|
1346
1355
|
{
|
|
@@ -1351,27 +1360,27 @@ function SubscriptionDetails({
|
|
|
1351
1360
|
] }),
|
|
1352
1361
|
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
1353
1362
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between", children: [
|
|
1354
|
-
/* @__PURE__ */ jsx17("span", { className: "text-
|
|
1355
|
-
/* @__PURE__ */ jsx17("span", { className: "
|
|
1363
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground text-xs", children: "Plan:" }),
|
|
1364
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm", children: formatPlanName2(subscription.price) })
|
|
1356
1365
|
] }),
|
|
1357
1366
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between", children: [
|
|
1358
|
-
/* @__PURE__ */ jsx17("span", { className: "text-
|
|
1359
|
-
/* @__PURE__ */ jsx17("span", { className: "
|
|
1367
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground text-xs", children: "Billing Amount:" }),
|
|
1368
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm", children: formatBillingAmount(subscription.price) })
|
|
1360
1369
|
] })
|
|
1361
1370
|
] }),
|
|
1362
1371
|
/* @__PURE__ */ jsx17("div", { className: "space-y-2", children: /* @__PURE__ */ jsxs14("div", { className: "flex justify-between", children: [
|
|
1363
|
-
/* @__PURE__ */ jsx17("span", { className: "text-
|
|
1364
|
-
/* @__PURE__ */ jsxs14("span", { className: "
|
|
1372
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground text-xs", children: "Current Period:" }),
|
|
1373
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-sm", children: [
|
|
1365
1374
|
formatDate3(subscription.currentPeriodStart),
|
|
1366
1375
|
" - ",
|
|
1367
1376
|
formatDate3(subscription.currentPeriodEnd)
|
|
1368
1377
|
] })
|
|
1369
1378
|
] }) }),
|
|
1370
1379
|
subscription.trialEnd && /* @__PURE__ */ jsxs14("div", { className: "flex justify-between", children: [
|
|
1371
|
-
/* @__PURE__ */ jsx17("span", { className: "text-
|
|
1372
|
-
/* @__PURE__ */ jsx17("span", { className: "
|
|
1380
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground text-xs", children: "Trial Ends:" }),
|
|
1381
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm", children: formatDate3(subscription.trialEnd) })
|
|
1373
1382
|
] }),
|
|
1374
|
-
subscription.cancelAtPeriodEnd && /* @__PURE__ */ jsx17("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs14("p", { className: "text-
|
|
1383
|
+
subscription.cancelAtPeriodEnd && /* @__PURE__ */ jsx17("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs14("p", { className: "text-warning text-xs/relaxed", children: [
|
|
1375
1384
|
"This subscription will be canceled at the end of the current period on",
|
|
1376
1385
|
" ",
|
|
1377
1386
|
formatDate3(subscription.currentPeriodEnd),
|
|
@@ -1524,7 +1533,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1524
1533
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
|
|
1525
1534
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-x-3", children: [
|
|
1526
1535
|
/* @__PURE__ */ jsx19(CreditCard3, { className: "h-8 w-8" }),
|
|
1527
|
-
/* @__PURE__ */ jsx19("h1", { className: "text-3xl font-
|
|
1536
|
+
/* @__PURE__ */ jsx19("h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1528
1537
|
] }),
|
|
1529
1538
|
subscriptions.length > 0 && /* @__PURE__ */ jsx19(Button, { onClick: () => onOpenWizard?.(), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1530
1539
|
] }),
|
|
@@ -1532,7 +1541,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1532
1541
|
subscriptions.length === 0 && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
1533
1542
|
/* @__PURE__ */ jsx19(CreditCard3, { className: "h-16 w-16 text-muted-foreground" }),
|
|
1534
1543
|
/* @__PURE__ */ jsxs16("div", { className: "text-center", children: [
|
|
1535
|
-
/* @__PURE__ */ jsx19("h3", { className: "text-
|
|
1544
|
+
/* @__PURE__ */ jsx19("h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1536
1545
|
/* @__PURE__ */ jsx19("p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1537
1546
|
/* @__PURE__ */ jsx19(Button, { onClick: () => onOpenWizard?.(), children: "Subscribe to a Plan" })
|
|
1538
1547
|
] })
|
|
@@ -1608,14 +1617,14 @@ function PricingCard({
|
|
|
1608
1617
|
),
|
|
1609
1618
|
children: [
|
|
1610
1619
|
isCurrentPlan && /* @__PURE__ */ jsx21(Badge, { variant: "secondary", className: "absolute top-2 right-2", children: "Current" }),
|
|
1611
|
-
/* @__PURE__ */ jsx21(CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsx21("h3", { className: "
|
|
1620
|
+
/* @__PURE__ */ jsx21(CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsx21("h3", { className: "text-sm font-medium", children: description }) }),
|
|
1612
1621
|
/* @__PURE__ */ jsxs18(CardContent, { className: "pb-4 grow", children: [
|
|
1613
1622
|
/* @__PURE__ */ jsxs18("div", { className: "mb-4", children: [
|
|
1614
1623
|
/* @__PURE__ */ jsx21("span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1615
1624
|
/* @__PURE__ */ jsx21("span", { className: "text-muted-foreground ml-1", children: interval })
|
|
1616
1625
|
] }),
|
|
1617
1626
|
features.length > 0 && /* @__PURE__ */ jsx21("ul", { className: "space-y-2", children: features.map((feature, index) => /* @__PURE__ */ jsxs18("li", { className: "flex items-start gap-2", children: [
|
|
1618
|
-
/* @__PURE__ */ jsx21(Check, { className: "
|
|
1627
|
+
/* @__PURE__ */ jsx21(Check, { className: "text-success mt-0.5 h-4 w-4 shrink-0" }),
|
|
1619
1628
|
/* @__PURE__ */ jsx21("span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1620
1629
|
] }, index)) })
|
|
1621
1630
|
] }),
|
|
@@ -1648,7 +1657,7 @@ function ProductPricingRow({
|
|
|
1648
1657
|
return null;
|
|
1649
1658
|
}
|
|
1650
1659
|
return /* @__PURE__ */ jsxs19("div", { className: "space-y-3", children: [
|
|
1651
|
-
/* @__PURE__ */ jsx22(
|
|
1660
|
+
/* @__PURE__ */ jsx22(SectionHeader, { children: product.name }),
|
|
1652
1661
|
/* @__PURE__ */ jsx22(
|
|
1653
1662
|
"div",
|
|
1654
1663
|
{
|
|
@@ -1770,7 +1779,7 @@ function ProrationPreview({ preview }) {
|
|
|
1770
1779
|
/* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
1771
1780
|
preview.lineItems.map((item, index) => /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-sm", children: [
|
|
1772
1781
|
/* @__PURE__ */ jsx24("span", { className: "text-blue-800", children: item.description }),
|
|
1773
|
-
/* @__PURE__ */ jsx24("span", { className: `font-medium ${item.amount < 0 ? "text-
|
|
1782
|
+
/* @__PURE__ */ jsx24("span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-blue-900"}`, children: formatCurrency(item.amount, preview.currency) })
|
|
1774
1783
|
] }, index)),
|
|
1775
1784
|
/* @__PURE__ */ jsx24("div", { className: "border-t border-blue-200 pt-2 mt-2", children: /* @__PURE__ */ jsxs21("div", { className: "flex justify-between font-semibold", children: [
|
|
1776
1785
|
/* @__PURE__ */ jsx24("span", { className: "text-blue-900", children: "Net Due Today" }),
|
|
@@ -2198,9 +2207,9 @@ function PromoCodeInput({
|
|
|
2198
2207
|
return /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
2199
2208
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between p-3 bg-green-50 border border-green-200 rounded-lg", children: [
|
|
2200
2209
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
2201
|
-
/* @__PURE__ */ jsx28(Check4, { className: "h-4 w-4
|
|
2202
|
-
/* @__PURE__ */ jsx28("span", { className: "font-medium
|
|
2203
|
-
/* @__PURE__ */ jsx28("span", { className: "text-
|
|
2210
|
+
/* @__PURE__ */ jsx28(Check4, { className: "text-success h-4 w-4" }),
|
|
2211
|
+
/* @__PURE__ */ jsx28("span", { className: "text-success font-medium", children: appliedCode.code }),
|
|
2212
|
+
/* @__PURE__ */ jsx28("span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2204
2213
|
] }),
|
|
2205
2214
|
/* @__PURE__ */ jsx28(
|
|
2206
2215
|
Button,
|
|
@@ -2209,12 +2218,12 @@ function PromoCodeInput({
|
|
|
2209
2218
|
size: "sm",
|
|
2210
2219
|
onClick: onRemove,
|
|
2211
2220
|
disabled,
|
|
2212
|
-
className: "text-
|
|
2221
|
+
className: "text-success hover:bg-green-100 hover:text-success",
|
|
2213
2222
|
children: /* @__PURE__ */ jsx28(X, { className: "h-4 w-4" })
|
|
2214
2223
|
}
|
|
2215
2224
|
)
|
|
2216
2225
|
] }),
|
|
2217
|
-
/* @__PURE__ */ jsx28("p", { className: "text-
|
|
2226
|
+
/* @__PURE__ */ jsx28("p", { className: "text-success text-sm", children: formatDuration(appliedCode) })
|
|
2218
2227
|
] });
|
|
2219
2228
|
}
|
|
2220
2229
|
return /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
@@ -2232,7 +2241,7 @@ function PromoCodeInput({
|
|
|
2232
2241
|
),
|
|
2233
2242
|
/* @__PURE__ */ jsx28(Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ jsx28(Loader22, { className: "h-4 w-4 animate-spin" }) : "Apply" })
|
|
2234
2243
|
] }),
|
|
2235
|
-
error && /* @__PURE__ */ jsx28("p", { className: "text-
|
|
2244
|
+
error && /* @__PURE__ */ jsx28("p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2236
2245
|
] });
|
|
2237
2246
|
}
|
|
2238
2247
|
__name(PromoCodeInput, "PromoCodeInput");
|
|
@@ -2302,7 +2311,7 @@ function WizardStepReview({
|
|
|
2302
2311
|
const discountDescription = getDiscountDescription();
|
|
2303
2312
|
return /* @__PURE__ */ jsxs26("div", { className: "space-y-6", children: [
|
|
2304
2313
|
/* @__PURE__ */ jsxs26("div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2305
|
-
/* @__PURE__ */ jsx29(
|
|
2314
|
+
/* @__PURE__ */ jsx29(SectionHeader, { children: "Selected Plan" }),
|
|
2306
2315
|
/* @__PURE__ */ jsxs26("div", { className: "flex justify-between items-center", children: [
|
|
2307
2316
|
/* @__PURE__ */ jsxs26("div", { children: [
|
|
2308
2317
|
/* @__PURE__ */ jsx29("p", { className: "font-medium", children: selectedPrice.product?.name }),
|
|
@@ -2311,8 +2320,8 @@ function WizardStepReview({
|
|
|
2311
2320
|
/* @__PURE__ */ jsxs26("div", { className: "text-right", children: [
|
|
2312
2321
|
discountedPrice !== null ? /* @__PURE__ */ jsxs26(Fragment6, { children: [
|
|
2313
2322
|
/* @__PURE__ */ jsx29("p", { className: "text-sm text-muted-foreground line-through", children: formatCurrency(selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2314
|
-
/* @__PURE__ */ jsx29("p", { className: "
|
|
2315
|
-
discountDescription && /* @__PURE__ */ jsx29(
|
|
2323
|
+
/* @__PURE__ */ jsx29("p", { className: "text-success text-lg font-semibold", children: formatCurrency(discountedPrice, selectedPrice.currency) }),
|
|
2324
|
+
discountDescription && /* @__PURE__ */ jsx29(Badge, { variant: "softGreen", children: discountDescription })
|
|
2316
2325
|
] }) : /* @__PURE__ */ jsx29("p", { className: "font-semibold text-lg", children: formatCurrency(selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2317
2326
|
/* @__PURE__ */ jsx29("p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2318
2327
|
] })
|
|
@@ -2323,13 +2332,13 @@ function WizardStepReview({
|
|
|
2323
2332
|
{
|
|
2324
2333
|
className: `${isTrialUpgrade ? "bg-amber-50 border-amber-200" : "bg-blue-50 border-blue-200"} border rounded-lg p-4 space-y-2`,
|
|
2325
2334
|
children: [
|
|
2326
|
-
/* @__PURE__ */ jsx29("h4", { className: `font-medium ${isTrialUpgrade ? "text-
|
|
2327
|
-
/* @__PURE__ */ jsx29("p", { className: `text-sm ${isTrialUpgrade ? "text-
|
|
2335
|
+
/* @__PURE__ */ jsx29("h4", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-blue-800"}`, children: isTrialUpgrade ? "Trial Upgrade" : "Proration Summary" }),
|
|
2336
|
+
/* @__PURE__ */ jsx29("p", { className: `text-sm ${isTrialUpgrade ? "text-warning" : "text-blue-700"}`, 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." }),
|
|
2328
2337
|
/* @__PURE__ */ jsxs26("div", { className: "flex justify-between text-sm", children: [
|
|
2329
|
-
/* @__PURE__ */ jsx29("span", { className: `${isTrialUpgrade ? "text-
|
|
2330
|
-
/* @__PURE__ */ jsx29("span", { className: `font-medium ${isTrialUpgrade ? "text-
|
|
2338
|
+
/* @__PURE__ */ jsx29("span", { className: `${isTrialUpgrade ? "text-warning" : "text-blue-600"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2339
|
+
/* @__PURE__ */ jsx29("span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-blue-800"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ jsxs26(Fragment6, { children: [
|
|
2331
2340
|
/* @__PURE__ */ jsx29("span", { className: "line-through text-muted-foreground mr-2", children: formatCurrency(prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2332
|
-
/* @__PURE__ */ jsx29("span", { className: "text-
|
|
2341
|
+
/* @__PURE__ */ jsx29("span", { className: "text-success", children: formatCurrency(discountedImmediateCharge, prorationPreview.currency) })
|
|
2333
2342
|
] }) : formatCurrency(prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2334
2343
|
] })
|
|
2335
2344
|
]
|
|
@@ -2373,7 +2382,7 @@ import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
|
2373
2382
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2374
2383
|
return /* @__PURE__ */ jsxs27("div", { className: "space-y-6", children: [
|
|
2375
2384
|
/* @__PURE__ */ jsxs27("div", { className: "text-center", children: [
|
|
2376
|
-
/* @__PURE__ */ jsx30(
|
|
2385
|
+
/* @__PURE__ */ jsx30(SectionHeader, { children: "Add Payment Method" }),
|
|
2377
2386
|
/* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2378
2387
|
] }),
|
|
2379
2388
|
/* @__PURE__ */ jsx30(PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2505,14 +2514,14 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2505
2514
|
/* @__PURE__ */ jsxs29(CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2506
2515
|
/* @__PURE__ */ jsx32("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600", children: /* @__PURE__ */ jsx32(Activity2, { className: "h-5 w-5" }) }),
|
|
2507
2516
|
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col", children: [
|
|
2508
|
-
/* @__PURE__ */ jsx32("h3", { className: "font-
|
|
2509
|
-
/* @__PURE__ */ jsx32("p", { className: "text-
|
|
2517
|
+
/* @__PURE__ */ jsx32("h3", { className: "text-sm font-medium", children: displayName }),
|
|
2518
|
+
/* @__PURE__ */ jsx32("p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2510
2519
|
] })
|
|
2511
2520
|
] }),
|
|
2512
2521
|
/* @__PURE__ */ jsxs29(CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2513
2522
|
/* @__PURE__ */ jsxs29("div", { children: [
|
|
2514
2523
|
/* @__PURE__ */ jsx32("p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2515
|
-
hasLimit && /* @__PURE__ */ jsxs29("p", { className: "text-
|
|
2524
|
+
hasLimit && /* @__PURE__ */ jsxs29("p", { className: "text-muted-foreground text-sm", children: [
|
|
2516
2525
|
"of ",
|
|
2517
2526
|
limit.toLocaleString(),
|
|
2518
2527
|
" used"
|
|
@@ -2520,12 +2529,12 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2520
2529
|
] }),
|
|
2521
2530
|
hasLimit ? /* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-y-2", children: [
|
|
2522
2531
|
/* @__PURE__ */ jsx32("div", { className: "h-2 w-full overflow-hidden rounded-full bg-gray-200", children: /* @__PURE__ */ jsx32("div", { className: `h-full transition-all ${progressColor}`, style: { width: `${progressWidth}%` } }) }),
|
|
2523
|
-
/* @__PURE__ */ jsxs29("p", { className: "text-
|
|
2532
|
+
/* @__PURE__ */ jsxs29("p", { className: "text-muted-foreground text-sm", children: [
|
|
2524
2533
|
percentage?.toFixed(1),
|
|
2525
2534
|
"% used"
|
|
2526
2535
|
] })
|
|
2527
|
-
] }) : /* @__PURE__ */ jsx32("p", { className: "text-
|
|
2528
|
-
summary && summary.start && summary.end && /* @__PURE__ */ jsx32("div", { className: "border-t pt-3", children: /* @__PURE__ */ jsxs29("p", { className: "text-
|
|
2536
|
+
] }) : /* @__PURE__ */ jsx32("p", { className: "text-muted-foreground text-sm", children: "No limit set" }),
|
|
2537
|
+
summary && summary.start && summary.end && /* @__PURE__ */ jsx32("div", { className: "border-t pt-3", children: /* @__PURE__ */ jsxs29("p", { className: "text-muted-foreground text-xs", children: [
|
|
2529
2538
|
"Period: ",
|
|
2530
2539
|
formatDate4(summary.start),
|
|
2531
2540
|
" - ",
|
|
@@ -2599,12 +2608,12 @@ function UsageContainer() {
|
|
|
2599
2608
|
return /* @__PURE__ */ jsxs30("div", { className: "flex w-full flex-col gap-y-6", children: [
|
|
2600
2609
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-x-3", children: [
|
|
2601
2610
|
/* @__PURE__ */ jsx34(Activity3, { className: "h-8 w-8" }),
|
|
2602
|
-
/* @__PURE__ */ jsx34("h1", { className: "text-3xl font-
|
|
2611
|
+
/* @__PURE__ */ jsx34("h1", { className: "text-primary text-3xl font-semibold", children: "Usage Tracking" })
|
|
2603
2612
|
] }),
|
|
2604
2613
|
meters.length === 0 && /* @__PURE__ */ jsxs30("div", { className: "bg-muted/50 flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 p-12", children: [
|
|
2605
2614
|
/* @__PURE__ */ jsx34(Activity3, { className: "text-muted-foreground h-16 w-16" }),
|
|
2606
2615
|
/* @__PURE__ */ jsxs30("div", { className: "text-center", children: [
|
|
2607
|
-
/* @__PURE__ */ jsx34("h3", { className: "mb-2 text-
|
|
2616
|
+
/* @__PURE__ */ jsx34("h3", { className: "mb-2 text-sm font-medium", children: "No usage meters configured" }),
|
|
2608
2617
|
/* @__PURE__ */ jsx34("p", { className: "text-muted-foreground", children: "Usage tracking will appear here when you have metered subscriptions with configured meters." })
|
|
2609
2618
|
] })
|
|
2610
2619
|
] }),
|
|
@@ -2636,7 +2645,7 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2636
2645
|
return /* @__PURE__ */ jsx35("div", { className: "rounded-lg border p-8 text-center", children: /* @__PURE__ */ jsx35("p", { className: "text-muted-foreground", children: "No usage history available." }) });
|
|
2637
2646
|
}
|
|
2638
2647
|
return /* @__PURE__ */ jsxs31("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2639
|
-
/* @__PURE__ */ jsx35(
|
|
2648
|
+
/* @__PURE__ */ jsx35(SectionHeader, { level: 2, children: "Usage History" }),
|
|
2640
2649
|
/* @__PURE__ */ jsx35("div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ jsxs31(Table, { children: [
|
|
2641
2650
|
/* @__PURE__ */ jsx35(TableHeader, { className: "bg-muted", children: /* @__PURE__ */ jsxs31(TableRow, { children: [
|
|
2642
2651
|
/* @__PURE__ */ jsx35(TableHead, { children: "Date & Time" }),
|
|
@@ -2651,7 +2660,7 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2651
2660
|
/* @__PURE__ */ jsx35(TableCell, { className: "font-medium", children: dateTime }),
|
|
2652
2661
|
/* @__PURE__ */ jsx35(TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2653
2662
|
/* @__PURE__ */ jsx35(TableCell, { className: "text-right font-medium", children: quantity }),
|
|
2654
|
-
/* @__PURE__ */ jsx35(TableCell, { className: "text-muted-foreground text-sm
|
|
2663
|
+
/* @__PURE__ */ jsx35(TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2655
2664
|
] }, record.id);
|
|
2656
2665
|
}) })
|
|
2657
2666
|
] }) })
|
|
@@ -2675,12 +2684,12 @@ import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
|
2675
2684
|
function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
2676
2685
|
if (subscription.status === "past_due" /* PAST_DUE */) {
|
|
2677
2686
|
return /* @__PURE__ */ jsxs33("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4 flex items-start gap-x-3", children: [
|
|
2678
|
-
/* @__PURE__ */ jsx37(AlertCircle2, { className: "
|
|
2687
|
+
/* @__PURE__ */ jsx37(AlertCircle2, { className: "text-destructive mt-0.5 h-5 w-5" }),
|
|
2679
2688
|
/* @__PURE__ */ jsxs33("div", { className: "flex-1", children: [
|
|
2680
|
-
/* @__PURE__ */ jsx37("h3", { className: "
|
|
2681
|
-
/* @__PURE__ */ jsx37("p", { className: "text-
|
|
2689
|
+
/* @__PURE__ */ jsx37("h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2690
|
+
/* @__PURE__ */ jsx37("p", { className: "text-destructive mt-1 text-sm", children: "Your last payment failed. Please update your payment method to avoid service interruption." })
|
|
2682
2691
|
] }),
|
|
2683
|
-
onUpdatePayment && /* @__PURE__ */ jsx37(Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "border-red-300
|
|
2692
|
+
onUpdatePayment && /* @__PURE__ */ jsx37(Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2684
2693
|
] });
|
|
2685
2694
|
}
|
|
2686
2695
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2689,10 +2698,10 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2689
2698
|
const daysRemaining = Math.ceil((trialEnd.getTime() - now.getTime()) / (1e3 * 60 * 60 * 24));
|
|
2690
2699
|
if (daysRemaining <= 7) {
|
|
2691
2700
|
return /* @__PURE__ */ jsxs33("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-4 flex items-start gap-x-3", children: [
|
|
2692
|
-
/* @__PURE__ */ jsx37(AlertCircle2, { className: "
|
|
2701
|
+
/* @__PURE__ */ jsx37(AlertCircle2, { className: "text-warning mt-0.5 h-5 w-5" }),
|
|
2693
2702
|
/* @__PURE__ */ jsxs33("div", { className: "flex-1", children: [
|
|
2694
|
-
/* @__PURE__ */ jsx37("h3", { className: "
|
|
2695
|
-
/* @__PURE__ */ jsxs33("p", { className: "text-
|
|
2703
|
+
/* @__PURE__ */ jsx37("h3", { className: "text-warning text-sm font-medium", children: "Trial Ending Soon" }),
|
|
2704
|
+
/* @__PURE__ */ jsxs33("p", { className: "text-warning mt-1 text-sm", children: [
|
|
2696
2705
|
"Your trial ends in ",
|
|
2697
2706
|
daysRemaining,
|
|
2698
2707
|
" ",
|
|
@@ -2700,7 +2709,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2700
2709
|
". Add a payment method to continue your subscription."
|
|
2701
2710
|
] })
|
|
2702
2711
|
] }),
|
|
2703
|
-
onAddPayment && /* @__PURE__ */ jsx37(Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "border-yellow-300
|
|
2712
|
+
onAddPayment && /* @__PURE__ */ jsx37(Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2704
2713
|
] });
|
|
2705
2714
|
}
|
|
2706
2715
|
}
|
|
@@ -2922,7 +2931,7 @@ function BillingDashboardContainer() {
|
|
|
2922
2931
|
return /* @__PURE__ */ jsxs34("div", { className: "flex w-full flex-col gap-y-6", children: [
|
|
2923
2932
|
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-x-3", children: [
|
|
2924
2933
|
/* @__PURE__ */ jsx38(Wallet2, { className: "h-8 w-8" }),
|
|
2925
|
-
/* @__PURE__ */ jsx38("h1", { className: "text-3xl font-
|
|
2934
|
+
/* @__PURE__ */ jsx38("h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2926
2935
|
] }),
|
|
2927
2936
|
isInitialLoading && /* @__PURE__ */ jsx38(Card, { children: /* @__PURE__ */ jsx38(CardContent, { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx38(Loader23, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) }),
|
|
2928
2937
|
noCustomerExists && !isInitialLoading && /* @__PURE__ */ jsxs34(Card, { children: [
|
|
@@ -2935,7 +2944,7 @@ function BillingDashboardContainer() {
|
|
|
2935
2944
|
/* @__PURE__ */ jsx38(Loader23, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2936
2945
|
"Setting up..."
|
|
2937
2946
|
] }) : "Set Up Billing Account" }) }),
|
|
2938
|
-
errors.customer && /* @__PURE__ */ jsx38(CardContent, { className: "pt-0", children: /* @__PURE__ */ jsx38("p", { className: "text-center text-
|
|
2947
|
+
errors.customer && /* @__PURE__ */ jsx38(CardContent, { className: "pt-0", children: /* @__PURE__ */ jsx38("p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2939
2948
|
] }),
|
|
2940
2949
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
2941
2950
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ jsx38(
|
|
@@ -3563,9 +3572,9 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3563
3572
|
] }) }),
|
|
3564
3573
|
price.metadata?.nickname && /* @__PURE__ */ jsx41("p", { className: "text-sm font-medium mb-2", children: price.metadata.nickname }),
|
|
3565
3574
|
/* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-2", children: [
|
|
3566
|
-
price.active ? /* @__PURE__ */ jsx41(
|
|
3567
|
-
price.recurring?.usageType === "metered" && /* @__PURE__ */ jsx41(
|
|
3568
|
-
/* @__PURE__ */ jsx41(
|
|
3575
|
+
price.active ? /* @__PURE__ */ jsx41(Badge, { variant: "softGreen", children: "Active" }) : /* @__PURE__ */ jsx41(Badge, { variant: "softGray", children: "Inactive" }),
|
|
3576
|
+
price.recurring?.usageType === "metered" && /* @__PURE__ */ jsx41(Badge, { variant: "softBlue", children: "Metered" }),
|
|
3577
|
+
/* @__PURE__ */ jsx41(Badge, { variant: "softGray", className: "uppercase", children: price.currency })
|
|
3569
3578
|
] })
|
|
3570
3579
|
] }, price.id);
|
|
3571
3580
|
}) }),
|
|
@@ -3775,8 +3784,8 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3775
3784
|
/* @__PURE__ */ jsx43(Package, { className: "h-6 w-6 text-primary" }),
|
|
3776
3785
|
/* @__PURE__ */ jsxs38("div", { className: "flex-1", children: [
|
|
3777
3786
|
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-x-3", children: [
|
|
3778
|
-
/* @__PURE__ */ jsx43("h3", { className: "text-
|
|
3779
|
-
product.active ? /* @__PURE__ */ jsx43(
|
|
3787
|
+
/* @__PURE__ */ jsx43("h3", { className: "text-sm font-medium", children: product.name }),
|
|
3788
|
+
product.active ? /* @__PURE__ */ jsx43(Badge, { variant: "softGreen", children: "Active" }) : /* @__PURE__ */ jsx43(Badge, { variant: "softGray", children: "Inactive" })
|
|
3780
3789
|
] }),
|
|
3781
3790
|
product.description && /* @__PURE__ */ jsx43("p", { className: "text-muted-foreground text-sm mt-1", children: product.description })
|
|
3782
3791
|
] })
|
|
@@ -3885,7 +3894,7 @@ function ProductsAdminContainer() {
|
|
|
3885
3894
|
const [loading, setLoading] = useState19(true);
|
|
3886
3895
|
const [showCreateProduct, setShowCreateProduct] = useState19(false);
|
|
3887
3896
|
if (!hasRole(getRoleId().Administrator)) {
|
|
3888
|
-
return /* @__PURE__ */ jsx44("div", { className: "flex h-64 items-center justify-center", children: /* @__PURE__ */ jsx44("p", { className: "text-
|
|
3897
|
+
return /* @__PURE__ */ jsx44("div", { className: "flex h-64 items-center justify-center", children: /* @__PURE__ */ jsx44("p", { className: "text-destructive text-xs/relaxed", children: "Permission denied. Administrator access required." }) });
|
|
3889
3898
|
}
|
|
3890
3899
|
const loadProducts = /* @__PURE__ */ __name(async () => {
|
|
3891
3900
|
setLoading(true);
|
|
@@ -3908,14 +3917,14 @@ function ProductsAdminContainer() {
|
|
|
3908
3917
|
/* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between", children: [
|
|
3909
3918
|
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-x-3", children: [
|
|
3910
3919
|
/* @__PURE__ */ jsx44(Package2, { className: "h-8 w-8" }),
|
|
3911
|
-
/* @__PURE__ */ jsx44("h1", { className: "text-3xl font-
|
|
3920
|
+
/* @__PURE__ */ jsx44("h1", { className: "text-primary text-3xl font-semibold", children: "Product & Price Management" })
|
|
3912
3921
|
] }),
|
|
3913
3922
|
/* @__PURE__ */ jsx44(Button, { onClick: () => setShowCreateProduct(true), children: "Create Product" })
|
|
3914
3923
|
] }),
|
|
3915
3924
|
products.length === 0 && /* @__PURE__ */ jsxs39("div", { className: "bg-muted/50 flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed p-12", children: [
|
|
3916
3925
|
/* @__PURE__ */ jsx44(Package2, { className: "text-muted-foreground h-16 w-16" }),
|
|
3917
3926
|
/* @__PURE__ */ jsxs39("div", { className: "text-center", children: [
|
|
3918
|
-
/* @__PURE__ */ jsx44("h3", { className: "mb-2 text-
|
|
3927
|
+
/* @__PURE__ */ jsx44("h3", { className: "mb-2 text-sm font-medium", children: "No products yet" }),
|
|
3919
3928
|
/* @__PURE__ */ jsx44("p", { className: "text-muted-foreground mb-4", children: "Create your first product to start offering subscriptions to your customers." }),
|
|
3920
3929
|
/* @__PURE__ */ jsx44(Button, { onClick: () => setShowCreateProduct(true), children: "Create Your First Product" })
|
|
3921
3930
|
] })
|