@bunnyapp/components 1.7.0-beta.40 → 1.7.0-beta.42
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/cjs/index.js +12 -12
- package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +2 -1
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/Upgrade.d.ts +4 -5
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +2 -3
- package/dist/esm/index.js +12 -12
- package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +2 -1
- package/dist/esm/types/src/components/Subscriptions/Upgrade/Upgrade.d.ts +4 -5
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +2 -3
- package/dist/index.d.ts +6 -6
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1283,7 +1283,7 @@ const DEFAULT_CONFIG = {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
|
|
1285
1285
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1286
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1286
|
+
const PACKAGE_VERSION = '1.7.0-beta.41';
|
|
1287
1287
|
const createRequestHeaders = (token) => {
|
|
1288
1288
|
const headers = createClientDevHeaders({ token });
|
|
1289
1289
|
// Add the components version header
|
|
@@ -28713,7 +28713,7 @@ const useQuoteRecalculateTaxes$1 = () => {
|
|
|
28713
28713
|
};
|
|
28714
28714
|
};
|
|
28715
28715
|
|
|
28716
|
-
const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
28716
|
+
const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }) => {
|
|
28717
28717
|
const token = useToken();
|
|
28718
28718
|
const queryClient = reactQuery.useQueryClient();
|
|
28719
28719
|
const showSuccessNotification = useSuccessNotification();
|
|
@@ -28734,7 +28734,6 @@ const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityD
|
|
|
28734
28734
|
invalidateSubscriptionsQueryKeys(queryClient, token);
|
|
28735
28735
|
showSuccessNotification('Your plan has been updated', 'Payment successful');
|
|
28736
28736
|
setPayModalVisible(false);
|
|
28737
|
-
setShowInactive(true);
|
|
28738
28737
|
setUpdatingChargeQuantityId(undefined);
|
|
28739
28738
|
};
|
|
28740
28739
|
const onCancel = () => {
|
|
@@ -28755,12 +28754,12 @@ const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityD
|
|
|
28755
28754
|
};
|
|
28756
28755
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuantityChangeDrawerDesktop, { onClose: handleDrawerClose, open: quantityDrawerOpen, openCheckout: handleOpenCheckout, subscriptions: subscriptions, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, onRecalculateTaxes: quoteRecalculateTaxesMutation, open: payModalVisible, quote: quote, token: token, isUpdatingQuote: false, isRecalculatingTaxes: isRecalculatingTaxes })] }));
|
|
28757
28756
|
};
|
|
28758
|
-
const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
28757
|
+
const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }) => {
|
|
28759
28758
|
const { quoteRecalculateTaxesMutation, isRecalculatingTaxes } = useQuoteRecalculateTaxes$1();
|
|
28760
28759
|
return (jsxRuntime.jsx(QuoteIdProvider, { children: jsxRuntime.jsx(QuoteIsLoadingProvider, { children: jsxRuntime.jsx(QuoteRecalculateTaxesProvider, { value: {
|
|
28761
28760
|
quoteRecalculateTaxesMutation: (quoteId) => quoteRecalculateTaxesMutation({ quoteId }),
|
|
28762
28761
|
isRecalculatingTaxes,
|
|
28763
|
-
}, children: jsxRuntime.jsx(QuantityDrawerContent, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors
|
|
28762
|
+
}, children: jsxRuntime.jsx(QuantityDrawerContent, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors }) }) }) }));
|
|
28764
28763
|
};
|
|
28765
28764
|
|
|
28766
28765
|
// TODO: this query will be trimmed and cleaned up once we fully migrate to gql.tada codegen
|
|
@@ -29617,7 +29616,7 @@ const getSubscriptions = async ({ apiHost, isInPreviewMode, token, }) => {
|
|
|
29617
29616
|
};
|
|
29618
29617
|
|
|
29619
29618
|
const showInfoNotification = useInfoNotification();
|
|
29620
|
-
const UpgradeWrapper = ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode, productId, className, shadow = 'md', defaultBillingPeriod, }) => {
|
|
29619
|
+
const UpgradeWrapper = ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode = false, productId, className, shadow = 'md', defaultBillingPeriod, }) => {
|
|
29621
29620
|
var _a, _b, _c;
|
|
29622
29621
|
// Context
|
|
29623
29622
|
const token = useToken();
|
|
@@ -29682,11 +29681,11 @@ const UpgradeContent = ({ onChangePlanCancel, handlePortalErrors, subscriptions,
|
|
|
29682
29681
|
if (isInPreviewMode)
|
|
29683
29682
|
return showInfoNotification('You are in preview mode');
|
|
29684
29683
|
onClearQuote();
|
|
29685
|
-
onChangePlanCancel();
|
|
29686
|
-
} }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", { className: `bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ${isSticky ? 'bunny-mx-4' : 'bunny-mx-0'}`, children: selectedPriceList && (jsxRuntime.jsx(PlanPickerCheckoutBar, { selectedPriceList: selectedPriceList, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: () => onChangePlanCancel() })) })] }));
|
|
29684
|
+
onChangePlanCancel === null || onChangePlanCancel === void 0 ? void 0 : onChangePlanCancel();
|
|
29685
|
+
} }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", { className: `bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ${isSticky ? 'bunny-mx-4' : 'bunny-mx-0'}`, children: selectedPriceList && (jsxRuntime.jsx(PlanPickerCheckoutBar, { selectedPriceList: selectedPriceList, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: () => onChangePlanCancel === null || onChangePlanCancel === void 0 ? void 0 : onChangePlanCancel() })) })] }));
|
|
29687
29686
|
};
|
|
29688
29687
|
|
|
29689
|
-
const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode = false, productId, className, styles: userStyles = {}, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle = true, onPaymentMethodSaved, onPaymentMethodRemoved, }) => {
|
|
29688
|
+
const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode = false, productId, className, styles: userStyles = {}, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle = true, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }) => {
|
|
29690
29689
|
var _a, _b;
|
|
29691
29690
|
// Context
|
|
29692
29691
|
const token = useToken();
|
|
@@ -29718,9 +29717,9 @@ const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode
|
|
|
29718
29717
|
productId,
|
|
29719
29718
|
isInPreviewMode,
|
|
29720
29719
|
showInactiveSubscriptions,
|
|
29721
|
-
}, children: jsxRuntime.jsx(UpgradingSubscriptionIdProvider, { children: jsxRuntime.jsx(OnPaymentMethodSavedProvider, { value: onPaymentMethodSaved, children: jsxRuntime.jsx(OnPaymentMethodRemovedProvider, { value: onPaymentMethodRemoved, children: jsxRuntime.jsx(Subscriptions, { subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, handlePortalErrors: handlePortalErrors, companyName: companyName, noSubscriptionsComponent: noSubscriptionsComponent, showInactiveSubscriptionsToggle: showInactiveSubscriptionsToggle }) }) }) }) }));
|
|
29720
|
+
}, children: jsxRuntime.jsx(UpgradingSubscriptionIdProvider, { children: jsxRuntime.jsx(OnPaymentMethodSavedProvider, { value: onPaymentMethodSaved, children: jsxRuntime.jsx(OnPaymentMethodRemovedProvider, { value: onPaymentMethodRemoved, children: jsxRuntime.jsx(Subscriptions, { subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, handlePortalErrors: handlePortalErrors, companyName: companyName, noSubscriptionsComponent: noSubscriptionsComponent, showInactiveSubscriptionsToggle: showInactiveSubscriptionsToggle, onSubscriptionUpgradeClick: onSubscriptionUpgradeClick }) }) }) }) }));
|
|
29722
29721
|
};
|
|
29723
|
-
const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoading, handlePortalErrors, companyName, noSubscriptionsComponent, showInactiveSubscriptionsToggle, }) => {
|
|
29722
|
+
const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoading, handlePortalErrors, companyName, noSubscriptionsComponent, showInactiveSubscriptionsToggle, onSubscriptionUpgradeClick, }) => {
|
|
29724
29723
|
// Context
|
|
29725
29724
|
const token = useToken();
|
|
29726
29725
|
const { apiHost } = react.useContext(BunnyContext);
|
|
@@ -29754,6 +29753,7 @@ const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoa
|
|
|
29754
29753
|
});
|
|
29755
29754
|
// Handlers
|
|
29756
29755
|
const onChangePlanClick = (subscriptionId) => {
|
|
29756
|
+
onSubscriptionUpgradeClick === null || onSubscriptionUpgradeClick === void 0 ? void 0 : onSubscriptionUpgradeClick(subscriptionId);
|
|
29757
29757
|
setUpgradingSubscriptionId(subscriptionId);
|
|
29758
29758
|
setIsChangingPlan(true);
|
|
29759
29759
|
};
|
|
@@ -29791,7 +29791,7 @@ const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoa
|
|
|
29791
29791
|
}
|
|
29792
29792
|
if (!subscriptions)
|
|
29793
29793
|
return null;
|
|
29794
|
-
return (jsxRuntime.jsx(UpgradingSubscriptionProvider, { value: upgradingSubscription, children: jsxRuntime.jsx(SubscriptionCancelProvider, { value: onCancelSubscriptionClick, children: jsxRuntime.jsx(ChangeUpgradingSubscriptionProvider, { value: onChangePlanClick, children: jsxRuntime.jsxs("div", { className: className, children: [jsxRuntime.jsx(PageHeaderWithActions, { title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: isMobile && inactiveSwitchVisible && (jsxRuntime.jsx(ShowInactiveToggle, { showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState })) }), children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) }), jsxRuntime.jsx(SubscriptionsListContainer, { companyName: companyName, showInactive: showInactiveSubscriptions, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsxRuntime.jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsxRuntime.jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) })), jsxRuntime.jsx(QuantityDrawer, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors
|
|
29794
|
+
return (jsxRuntime.jsx(UpgradingSubscriptionProvider, { value: upgradingSubscription, children: jsxRuntime.jsx(SubscriptionCancelProvider, { value: onCancelSubscriptionClick, children: jsxRuntime.jsx(ChangeUpgradingSubscriptionProvider, { value: onChangePlanClick, children: jsxRuntime.jsxs("div", { className: className, children: [jsxRuntime.jsx(PageHeaderWithActions, { title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: isMobile && inactiveSwitchVisible && (jsxRuntime.jsx(ShowInactiveToggle, { showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState })) }), children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) }), jsxRuntime.jsx(SubscriptionsListContainer, { companyName: companyName, showInactive: showInactiveSubscriptions, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsxRuntime.jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsxRuntime.jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) })), jsxRuntime.jsx(QuantityDrawer, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors })] }) }) }) }));
|
|
29795
29795
|
};
|
|
29796
29796
|
const PageHeaderWithActions = ({ children, title, }) => {
|
|
29797
29797
|
const isMobile = useIsMobile();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, }: {
|
|
1
|
+
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }: {
|
|
2
2
|
handlePortalErrors?: (errors: any) => void;
|
|
3
3
|
companyName: string;
|
|
4
4
|
isInPreviewMode?: boolean;
|
|
@@ -14,5 +14,6 @@ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPrev
|
|
|
14
14
|
showInactiveSubscriptionsToggle?: boolean;
|
|
15
15
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
16
16
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
17
|
+
onSubscriptionUpgradeClick?: (subscriptionId: string) => void;
|
|
17
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default SubscriptionsWrapper;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
1
|
declare const UpgradeWrapper: ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode, productId, className, shadow, defaultBillingPeriod, }: {
|
|
3
|
-
onChangePlanCancel
|
|
2
|
+
onChangePlanCancel?: () => void;
|
|
4
3
|
handlePortalErrors?: (error: any) => void;
|
|
5
4
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
6
5
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
7
6
|
upgradingSubscriptionId?: string;
|
|
8
|
-
isInPreviewMode
|
|
9
|
-
productId
|
|
7
|
+
isInPreviewMode?: boolean;
|
|
8
|
+
productId?: string | undefined;
|
|
10
9
|
className?: string;
|
|
11
10
|
shadow?: "none" | "sm" | "md" | "lg";
|
|
12
11
|
/**
|
|
13
12
|
* If provided and the billing period is available, the billing period selector will default to this value.
|
|
14
13
|
*/
|
|
15
|
-
defaultBillingPeriod?:
|
|
14
|
+
defaultBillingPeriod?: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL";
|
|
16
15
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
16
|
export default UpgradeWrapper;
|
package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ interface QuantityDrawerProps {
|
|
|
5
5
|
quantityDrawerOpen: boolean;
|
|
6
6
|
setQuantityDrawerOpen: (open: boolean) => void;
|
|
7
7
|
handlePortalErrors?: (errors: any) => void;
|
|
8
|
-
setShowInactive: (showInactive: boolean) => void;
|
|
9
8
|
}
|
|
10
|
-
export declare const QuantityDrawerContent: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
11
|
-
export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
9
|
+
export declare const QuantityDrawerContent: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ const DEFAULT_CONFIG = {
|
|
|
1281
1281
|
};
|
|
1282
1282
|
|
|
1283
1283
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1284
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1284
|
+
const PACKAGE_VERSION = '1.7.0-beta.41';
|
|
1285
1285
|
const createRequestHeaders = (token) => {
|
|
1286
1286
|
const headers = createClientDevHeaders({ token });
|
|
1287
1287
|
// Add the components version header
|
|
@@ -28711,7 +28711,7 @@ const useQuoteRecalculateTaxes$1 = () => {
|
|
|
28711
28711
|
};
|
|
28712
28712
|
};
|
|
28713
28713
|
|
|
28714
|
-
const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
28714
|
+
const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }) => {
|
|
28715
28715
|
const token = useToken();
|
|
28716
28716
|
const queryClient = useQueryClient();
|
|
28717
28717
|
const showSuccessNotification = useSuccessNotification();
|
|
@@ -28732,7 +28732,6 @@ const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityD
|
|
|
28732
28732
|
invalidateSubscriptionsQueryKeys(queryClient, token);
|
|
28733
28733
|
showSuccessNotification('Your plan has been updated', 'Payment successful');
|
|
28734
28734
|
setPayModalVisible(false);
|
|
28735
|
-
setShowInactive(true);
|
|
28736
28735
|
setUpdatingChargeQuantityId(undefined);
|
|
28737
28736
|
};
|
|
28738
28737
|
const onCancel = () => {
|
|
@@ -28753,12 +28752,12 @@ const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityD
|
|
|
28753
28752
|
};
|
|
28754
28753
|
return (jsxs(Fragment, { children: [jsx(QuantityChangeDrawerDesktop, { onClose: handleDrawerClose, open: quantityDrawerOpen, openCheckout: handleOpenCheckout, subscriptions: subscriptions, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId }), jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, onRecalculateTaxes: quoteRecalculateTaxesMutation, open: payModalVisible, quote: quote, token: token, isUpdatingQuote: false, isRecalculatingTaxes: isRecalculatingTaxes })] }));
|
|
28755
28754
|
};
|
|
28756
|
-
const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
28755
|
+
const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }) => {
|
|
28757
28756
|
const { quoteRecalculateTaxesMutation, isRecalculatingTaxes } = useQuoteRecalculateTaxes$1();
|
|
28758
28757
|
return (jsx(QuoteIdProvider, { children: jsx(QuoteIsLoadingProvider, { children: jsx(QuoteRecalculateTaxesProvider, { value: {
|
|
28759
28758
|
quoteRecalculateTaxesMutation: (quoteId) => quoteRecalculateTaxesMutation({ quoteId }),
|
|
28760
28759
|
isRecalculatingTaxes,
|
|
28761
|
-
}, children: jsx(QuantityDrawerContent, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors
|
|
28760
|
+
}, children: jsx(QuantityDrawerContent, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors }) }) }) }));
|
|
28762
28761
|
};
|
|
28763
28762
|
|
|
28764
28763
|
// TODO: this query will be trimmed and cleaned up once we fully migrate to gql.tada codegen
|
|
@@ -29615,7 +29614,7 @@ const getSubscriptions = async ({ apiHost, isInPreviewMode, token, }) => {
|
|
|
29615
29614
|
};
|
|
29616
29615
|
|
|
29617
29616
|
const showInfoNotification = useInfoNotification();
|
|
29618
|
-
const UpgradeWrapper = ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode, productId, className, shadow = 'md', defaultBillingPeriod, }) => {
|
|
29617
|
+
const UpgradeWrapper = ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode = false, productId, className, shadow = 'md', defaultBillingPeriod, }) => {
|
|
29619
29618
|
var _a, _b, _c;
|
|
29620
29619
|
// Context
|
|
29621
29620
|
const token = useToken();
|
|
@@ -29680,11 +29679,11 @@ const UpgradeContent = ({ onChangePlanCancel, handlePortalErrors, subscriptions,
|
|
|
29680
29679
|
if (isInPreviewMode)
|
|
29681
29680
|
return showInfoNotification('You are in preview mode');
|
|
29682
29681
|
onClearQuote();
|
|
29683
|
-
onChangePlanCancel();
|
|
29684
|
-
} }), jsx("div", { ref: stickyRef }), jsx("div", { className: `bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ${isSticky ? 'bunny-mx-4' : 'bunny-mx-0'}`, children: selectedPriceList && (jsx(PlanPickerCheckoutBar, { selectedPriceList: selectedPriceList, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: () => onChangePlanCancel() })) })] }));
|
|
29682
|
+
onChangePlanCancel === null || onChangePlanCancel === void 0 ? void 0 : onChangePlanCancel();
|
|
29683
|
+
} }), jsx("div", { ref: stickyRef }), jsx("div", { className: `bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ${isSticky ? 'bunny-mx-4' : 'bunny-mx-0'}`, children: selectedPriceList && (jsx(PlanPickerCheckoutBar, { selectedPriceList: selectedPriceList, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: () => onChangePlanCancel === null || onChangePlanCancel === void 0 ? void 0 : onChangePlanCancel() })) })] }));
|
|
29685
29684
|
};
|
|
29686
29685
|
|
|
29687
|
-
const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode = false, productId, className, styles: userStyles = {}, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle = true, onPaymentMethodSaved, onPaymentMethodRemoved, }) => {
|
|
29686
|
+
const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode = false, productId, className, styles: userStyles = {}, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle = true, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }) => {
|
|
29688
29687
|
var _a, _b;
|
|
29689
29688
|
// Context
|
|
29690
29689
|
const token = useToken();
|
|
@@ -29716,9 +29715,9 @@ const SubscriptionsWrapper = ({ handlePortalErrors, companyName, isInPreviewMode
|
|
|
29716
29715
|
productId,
|
|
29717
29716
|
isInPreviewMode,
|
|
29718
29717
|
showInactiveSubscriptions,
|
|
29719
|
-
}, children: jsx(UpgradingSubscriptionIdProvider, { children: jsx(OnPaymentMethodSavedProvider, { value: onPaymentMethodSaved, children: jsx(OnPaymentMethodRemovedProvider, { value: onPaymentMethodRemoved, children: jsx(Subscriptions, { subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, handlePortalErrors: handlePortalErrors, companyName: companyName, noSubscriptionsComponent: noSubscriptionsComponent, showInactiveSubscriptionsToggle: showInactiveSubscriptionsToggle }) }) }) }) }));
|
|
29718
|
+
}, children: jsx(UpgradingSubscriptionIdProvider, { children: jsx(OnPaymentMethodSavedProvider, { value: onPaymentMethodSaved, children: jsx(OnPaymentMethodRemovedProvider, { value: onPaymentMethodRemoved, children: jsx(Subscriptions, { subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, handlePortalErrors: handlePortalErrors, companyName: companyName, noSubscriptionsComponent: noSubscriptionsComponent, showInactiveSubscriptionsToggle: showInactiveSubscriptionsToggle, onSubscriptionUpgradeClick: onSubscriptionUpgradeClick }) }) }) }) }));
|
|
29720
29719
|
};
|
|
29721
|
-
const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoading, handlePortalErrors, companyName, noSubscriptionsComponent, showInactiveSubscriptionsToggle, }) => {
|
|
29720
|
+
const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoading, handlePortalErrors, companyName, noSubscriptionsComponent, showInactiveSubscriptionsToggle, onSubscriptionUpgradeClick, }) => {
|
|
29722
29721
|
// Context
|
|
29723
29722
|
const token = useToken();
|
|
29724
29723
|
const { apiHost } = useContext(BunnyContext);
|
|
@@ -29752,6 +29751,7 @@ const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoa
|
|
|
29752
29751
|
});
|
|
29753
29752
|
// Handlers
|
|
29754
29753
|
const onChangePlanClick = (subscriptionId) => {
|
|
29754
|
+
onSubscriptionUpgradeClick === null || onSubscriptionUpgradeClick === void 0 ? void 0 : onSubscriptionUpgradeClick(subscriptionId);
|
|
29755
29755
|
setUpgradingSubscriptionId(subscriptionId);
|
|
29756
29756
|
setIsChangingPlan(true);
|
|
29757
29757
|
};
|
|
@@ -29789,7 +29789,7 @@ const Subscriptions = ({ subscriptions: maskedSubscriptions, subscriptionsAreLoa
|
|
|
29789
29789
|
}
|
|
29790
29790
|
if (!subscriptions)
|
|
29791
29791
|
return null;
|
|
29792
|
-
return (jsx(UpgradingSubscriptionProvider, { value: upgradingSubscription, children: jsx(SubscriptionCancelProvider, { value: onCancelSubscriptionClick, children: jsx(ChangeUpgradingSubscriptionProvider, { value: onChangePlanClick, children: jsxs("div", { className: className, children: [jsx(PageHeaderWithActions, { title: jsx(Fragment, { children: isMobile && inactiveSwitchVisible && (jsx(ShowInactiveToggle, { showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState })) }), children: !isMobile && (jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) }), jsx(SubscriptionsListContainer, { companyName: companyName, showInactive: showInactiveSubscriptions, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) })), jsx(QuantityDrawer, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors
|
|
29792
|
+
return (jsx(UpgradingSubscriptionProvider, { value: upgradingSubscription, children: jsx(SubscriptionCancelProvider, { value: onCancelSubscriptionClick, children: jsx(ChangeUpgradingSubscriptionProvider, { value: onChangePlanClick, children: jsxs("div", { className: className, children: [jsx(PageHeaderWithActions, { title: jsx(Fragment, { children: isMobile && inactiveSwitchVisible && (jsx(ShowInactiveToggle, { showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState })) }), children: !isMobile && (jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) }), jsx(SubscriptionsListContainer, { companyName: companyName, showInactive: showInactiveSubscriptions, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) })), jsx(QuantityDrawer, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors })] }) }) }) }));
|
|
29793
29793
|
};
|
|
29794
29794
|
const PageHeaderWithActions = ({ children, title, }) => {
|
|
29795
29795
|
const isMobile = useIsMobile();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, }: {
|
|
1
|
+
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }: {
|
|
2
2
|
handlePortalErrors?: (errors: any) => void;
|
|
3
3
|
companyName: string;
|
|
4
4
|
isInPreviewMode?: boolean;
|
|
@@ -14,5 +14,6 @@ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPrev
|
|
|
14
14
|
showInactiveSubscriptionsToggle?: boolean;
|
|
15
15
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
16
16
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
17
|
+
onSubscriptionUpgradeClick?: (subscriptionId: string) => void;
|
|
17
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default SubscriptionsWrapper;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
1
|
declare const UpgradeWrapper: ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode, productId, className, shadow, defaultBillingPeriod, }: {
|
|
3
|
-
onChangePlanCancel
|
|
2
|
+
onChangePlanCancel?: () => void;
|
|
4
3
|
handlePortalErrors?: (error: any) => void;
|
|
5
4
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
6
5
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
7
6
|
upgradingSubscriptionId?: string;
|
|
8
|
-
isInPreviewMode
|
|
9
|
-
productId
|
|
7
|
+
isInPreviewMode?: boolean;
|
|
8
|
+
productId?: string | undefined;
|
|
10
9
|
className?: string;
|
|
11
10
|
shadow?: "none" | "sm" | "md" | "lg";
|
|
12
11
|
/**
|
|
13
12
|
* If provided and the billing period is available, the billing period selector will default to this value.
|
|
14
13
|
*/
|
|
15
|
-
defaultBillingPeriod?:
|
|
14
|
+
defaultBillingPeriod?: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL";
|
|
16
15
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
16
|
export default UpgradeWrapper;
|
package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ interface QuantityDrawerProps {
|
|
|
5
5
|
quantityDrawerOpen: boolean;
|
|
6
6
|
setQuantityDrawerOpen: (open: boolean) => void;
|
|
7
7
|
handlePortalErrors?: (errors: any) => void;
|
|
8
|
-
setShowInactive: (showInactive: boolean) => void;
|
|
9
8
|
}
|
|
10
|
-
export declare const QuantityDrawerContent: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
11
|
-
export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors,
|
|
9
|
+
export declare const QuantityDrawerContent: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import Invoice$1 from '@/types/Invoice';
|
|
|
8
8
|
import { QueryClient } from '@tanstack/react-query';
|
|
9
9
|
import { ThemeConfig } from 'antd';
|
|
10
10
|
import react from 'react';
|
|
11
|
-
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
12
11
|
|
|
13
12
|
type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
|
14
13
|
|
|
@@ -223,7 +222,7 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
|
|
|
223
222
|
hidePaymentForm?: boolean;
|
|
224
223
|
}): react_jsx_runtime.JSX.Element;
|
|
225
224
|
|
|
226
|
-
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, }: {
|
|
225
|
+
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }: {
|
|
227
226
|
handlePortalErrors?: (errors: any) => void;
|
|
228
227
|
companyName: string;
|
|
229
228
|
isInPreviewMode?: boolean;
|
|
@@ -239,22 +238,23 @@ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPrev
|
|
|
239
238
|
showInactiveSubscriptionsToggle?: boolean;
|
|
240
239
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
241
240
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
241
|
+
onSubscriptionUpgradeClick?: (subscriptionId: string) => void;
|
|
242
242
|
}) => react_jsx_runtime.JSX.Element;
|
|
243
243
|
|
|
244
244
|
declare const UpgradeWrapper: ({ onChangePlanCancel, handlePortalErrors, onPaymentMethodSaved, onPaymentMethodRemoved, upgradingSubscriptionId, isInPreviewMode, productId, className, shadow, defaultBillingPeriod, }: {
|
|
245
|
-
onChangePlanCancel
|
|
245
|
+
onChangePlanCancel?: () => void;
|
|
246
246
|
handlePortalErrors?: (error: any) => void;
|
|
247
247
|
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
248
248
|
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
249
249
|
upgradingSubscriptionId?: string;
|
|
250
|
-
isInPreviewMode
|
|
251
|
-
productId
|
|
250
|
+
isInPreviewMode?: boolean;
|
|
251
|
+
productId?: string | undefined;
|
|
252
252
|
className?: string;
|
|
253
253
|
shadow?: "none" | "sm" | "md" | "lg";
|
|
254
254
|
/**
|
|
255
255
|
* If provided and the billing period is available, the billing period selector will default to this value.
|
|
256
256
|
*/
|
|
257
|
-
defaultBillingPeriod?:
|
|
257
|
+
defaultBillingPeriod?: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL";
|
|
258
258
|
}) => react_jsx_runtime.JSX.Element | null;
|
|
259
259
|
|
|
260
260
|
declare const BillingDetails: ({ className, countryListFilter, hideBillingDetailsForm, hidePaymentMethodForm, isCardEnabled, isUpgradeFromTrial, shadow, onSavePaymentMethod, onPaymentMethodRemoved, }: {
|
package/package.json
CHANGED