subos-frontend 1.0.103 → 1.0.104
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 +22 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/planUtils.d.ts +9 -0
- package/dist/types/utils/planUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -610,6 +610,27 @@ var formatDate = (dateString, format = "date") => {
|
|
|
610
610
|
day: "numeric"
|
|
611
611
|
}).format(date);
|
|
612
612
|
};
|
|
613
|
+
var getGracePeriodInfo = (subscription) => {
|
|
614
|
+
var _a;
|
|
615
|
+
if (!((_a = subscription == null ? void 0 : subscription.meta) == null ? void 0 : _a.isGracePeriod)) {
|
|
616
|
+
return null;
|
|
617
|
+
}
|
|
618
|
+
const startDate = subscription.meta.gracePeriodStart;
|
|
619
|
+
const endDate = subscription.meta.gracePeriodEnd;
|
|
620
|
+
let remainingDays = subscription.remainingGracePeriodDays ?? 0;
|
|
621
|
+
if (endDate) {
|
|
622
|
+
const end = new Date(endDate).getTime();
|
|
623
|
+
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
624
|
+
const diff = end - now;
|
|
625
|
+
remainingDays = Math.max(0, Math.ceil(diff / (1e3 * 60 * 60 * 24)));
|
|
626
|
+
}
|
|
627
|
+
return {
|
|
628
|
+
startDate,
|
|
629
|
+
endDate,
|
|
630
|
+
remainingDays,
|
|
631
|
+
message: `Your 7-day grace period started on ${startDate ? formatDate(startDate) : "N/A"}. You have ${remainingDays} days remaining to update your payment method to continue your subscription without interruption.`
|
|
632
|
+
};
|
|
633
|
+
};
|
|
613
634
|
|
|
614
635
|
// src/hooks/usePlans.ts
|
|
615
636
|
var usePlans = () => {
|
|
@@ -3696,6 +3717,6 @@ var App = function App2({ externalId, initialPage }) {
|
|
|
3696
3717
|
return /* @__PURE__ */ jsx(CurrencyProvider, { children: /* @__PURE__ */ jsx(NavigationProvider, { initialPage: detectedPage, children: /* @__PURE__ */ jsx(AppContent, { externalId }) }) });
|
|
3697
3718
|
};
|
|
3698
3719
|
|
|
3699
|
-
export { AddCardIcon, AddIcon, App, BillingCycleToggle, CancelIcon, ChangeCardButton, CheckCircleIcon, CheckIcon, CreditCardIcon, CurrencyProvider, DashboardIcon, DashboardPage, DeleteIcon, DownloadIcon, EmailIcon, FilterIcon, GracePeriodNotification, Layout, LoadingSpinner, LogoInline, NavigationProvider, Pagination, PaymentCancelView, PaymentSuccessPage_default as PaymentSuccessPage, PaymentSuccessView, PlanCard, PlanSelector, PlansGrid, ReceiptIcon, ScheduledPlanNotification, SearchIcon, StarBorderIcon, SubOSThemeProvider, SubscriptionActionButtons, SubscriptionCancelButton, SubscriptionCancelModal, SubscriptionDetails, SubscriptionInfoGrid, SubscriptionTransactionButton, SubscriptionUsageDisplay, TierFilterDropdown, TransactionEmptyState, TransactionErrorState, TransactionFilter, TransactionItem, TransactionList, TransactionLoadingState, TransactionModal, TransactionPagination, TransactionStatusFilter, TrendingUpIcon, UpgradeIcon, UpgradeProvider, UpgradeSummary, clearSelectedPlan, configureSubOS, customerApi, ensureSubOSConfig, filterPlansByBillingCycle, filterPlansByTier, formatDate, getApiBaseUrl, getCandidateUnits, getCurrentSelectionText, getDropdownOptions, getPlanDescription, getPlanFeatures, getProjectId, getUniqueCandidateUnits, isPlanPopular, plansApi, registerClearSelectedPlan, subscriptionApi, transactionApi, unregisterClearSelectedPlan, useApplyHostTheme, useCancelSubscription, useCountryAndCurrency, useCurrency, useCustomerPortal, useNavigation, usePagination, usePlans, useSubOSTheme, useSubscription, useTransactions, useUpgrade, validateSubOSConfig };
|
|
3720
|
+
export { AddCardIcon, AddIcon, App, BillingCycleToggle, CancelIcon, ChangeCardButton, CheckCircleIcon, CheckIcon, CreditCardIcon, CurrencyProvider, DashboardIcon, DashboardPage, DeleteIcon, DownloadIcon, EmailIcon, FilterIcon, GracePeriodNotification, Layout, LoadingSpinner, LogoInline, NavigationProvider, Pagination, PaymentCancelView, PaymentSuccessPage_default as PaymentSuccessPage, PaymentSuccessView, PlanCard, PlanSelector, PlansGrid, ReceiptIcon, ScheduledPlanNotification, SearchIcon, StarBorderIcon, SubOSThemeProvider, SubscriptionActionButtons, SubscriptionCancelButton, SubscriptionCancelModal, SubscriptionDetails, SubscriptionInfoGrid, SubscriptionTransactionButton, SubscriptionUsageDisplay, TierFilterDropdown, TransactionEmptyState, TransactionErrorState, TransactionFilter, TransactionItem, TransactionList, TransactionLoadingState, TransactionModal, TransactionPagination, TransactionStatusFilter, TrendingUpIcon, UpgradeIcon, UpgradeProvider, UpgradeSummary, clearSelectedPlan, configureSubOS, customerApi, ensureSubOSConfig, filterPlansByBillingCycle, filterPlansByTier, formatDate, getApiBaseUrl, getCandidateUnits, getCurrentSelectionText, getDropdownOptions, getGracePeriodInfo, getPlanDescription, getPlanFeatures, getProjectId, getUniqueCandidateUnits, isPlanPopular, plansApi, registerClearSelectedPlan, subscriptionApi, transactionApi, unregisterClearSelectedPlan, useApplyHostTheme, useCancelSubscription, useCountryAndCurrency, useCurrency, useCustomerPortal, useNavigation, usePagination, usePlans, useSubOSTheme, useSubscription, useTransactions, useUpgrade, validateSubOSConfig };
|
|
3700
3721
|
//# sourceMappingURL=index.mjs.map
|
|
3701
3722
|
//# sourceMappingURL=index.mjs.map
|