@stigg/react-sdk 7.13.0 → 7.15.1
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.d.mts +151 -3
- package/dist/index.d.ts +151 -3
- package/dist/stigg-sdk.cjs.js +536 -294
- package/dist/stigg-sdk.esm.js +536 -294
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _stigg_js_client_sdk from '@stigg/js-client-sdk';
|
|
|
2
2
|
import { Plan, Customer, Subscription, BillingPeriod, BillableFeature, CustomerPortalSubscriptionScheduledUpdateDataFragment, PaywallCurrency, PaywallCalculatedPricePoint, PriceTierFragment, Price, CustomerPortalSubscription, CustomerPortalEntitlement, EntitlementsFallback, SubscriptionAddon, Addon, BillingAddress, SubscriptionBillingInfo, GetCheckoutState, GetCheckoutStateResults, ApplySubscription, ApplySubscriptionResults, CheckoutStatePlan, PreviewSubscription, SubscriptionPreviewV2, SubscriptionPreviewDiscount, SubscriptionPreviewTaxDetails, GetBooleanEntitlement, BooleanEntitlement, GetNumericEntitlement, NumericEntitlement, GetMeteredEntitlement, MeteredEntitlement, GetEnumEntitlement, EnumEntitlement, GetActiveSubscriptions, GetPaywall, GetCustomerPortal, CreditUsageTimeRange, GetCreditUsageInput, CursorPaging, CreditGrantFragment, PageInfoFragment } from '@stigg/js-client-sdk';
|
|
3
3
|
export * from '@stigg/js-client-sdk';
|
|
4
4
|
import { FeatureFragment, BillingPeriod as BillingPeriod$1, BillableFeatureInput } from '@stigg/api-client-js/src/generated/sdk';
|
|
5
|
-
import react, { PropsWithChildren, ReactNode } from 'react';
|
|
5
|
+
import react, { PropsWithChildren, ChangeEvent, ReactNode } from 'react';
|
|
6
6
|
import { ChipProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
type DeepPartial<T> = T extends object ? {
|
|
@@ -724,7 +724,7 @@ type CreditUtilizationLocalization = {
|
|
|
724
724
|
};
|
|
725
725
|
declare function CreditUtilization({ currencyId, localization, decimalPlaces, showUnits, showSymbol, }: CreditUtilizationProps): JSX.Element;
|
|
726
726
|
|
|
727
|
-
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt'>;
|
|
727
|
+
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt' | 'automaticRechargeConfigurationId'>;
|
|
728
728
|
declare enum CreditGrantStatus {
|
|
729
729
|
SCHEDULED = "SCHEDULED",
|
|
730
730
|
AVAILABLE = "AVAILABLE",
|
|
@@ -761,6 +761,154 @@ declare function useCreditGrants(params: GetCreditGrantsParams): {
|
|
|
761
761
|
totalCount?: number;
|
|
762
762
|
};
|
|
763
763
|
|
|
764
|
+
interface AutoRechargeStatusLocalization {
|
|
765
|
+
title?: string;
|
|
766
|
+
activeLabel?: string;
|
|
767
|
+
manageButton?: string;
|
|
768
|
+
descriptionTemplate?: string;
|
|
769
|
+
emptyStateMessage?: string;
|
|
770
|
+
spendTemplate?: string;
|
|
771
|
+
unlimitedSpendLimit?: string;
|
|
772
|
+
}
|
|
773
|
+
interface AutoRechargeStatusContentProps {
|
|
774
|
+
customerId: string;
|
|
775
|
+
currencyId: string;
|
|
776
|
+
currencyUnit?: string;
|
|
777
|
+
billingCurrency?: string;
|
|
778
|
+
onManageClick?: () => void;
|
|
779
|
+
className?: string;
|
|
780
|
+
localization?: AutoRechargeStatusLocalization;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
type AutoRechargeStatusProps = AutoRechargeStatusContentProps;
|
|
784
|
+
|
|
785
|
+
declare function AutoRechargeStatus(props: AutoRechargeStatusProps): JSX.Element;
|
|
786
|
+
|
|
787
|
+
interface AutomaticRechargeConfiguration {
|
|
788
|
+
id: string;
|
|
789
|
+
enabled: boolean;
|
|
790
|
+
thresholdAmount: number;
|
|
791
|
+
targetBalance: number;
|
|
792
|
+
maxSpendLimit?: number;
|
|
793
|
+
currencyId: string;
|
|
794
|
+
customerId: string;
|
|
795
|
+
currentMonthlySpend?: number;
|
|
796
|
+
}
|
|
797
|
+
interface UpdateAutomaticRechargeConfigParams {
|
|
798
|
+
customerId: string;
|
|
799
|
+
currencyId: string;
|
|
800
|
+
enabled: boolean;
|
|
801
|
+
thresholdAmount?: number;
|
|
802
|
+
targetBalance?: number;
|
|
803
|
+
maxSpendLimit?: number;
|
|
804
|
+
}
|
|
805
|
+
interface AutomaticRechargeConfigLocalization {
|
|
806
|
+
title?: string;
|
|
807
|
+
enableLabel?: string;
|
|
808
|
+
enableDescription?: string;
|
|
809
|
+
thresholdFieldPrefix?: string;
|
|
810
|
+
thresholdFieldSuffix?: string;
|
|
811
|
+
thresholdTooltip?: string;
|
|
812
|
+
thresholdFieldPlaceholder?: string;
|
|
813
|
+
thresholdFieldHint?: string;
|
|
814
|
+
thresholdRequired?: string;
|
|
815
|
+
thresholdMin?: string;
|
|
816
|
+
thresholdMax?: string;
|
|
817
|
+
targetFieldPrefix?: string;
|
|
818
|
+
targetFieldSuffix?: string;
|
|
819
|
+
targetBalanceTooltip?: string;
|
|
820
|
+
targetFieldPlaceholder?: string;
|
|
821
|
+
targetFieldHint?: string;
|
|
822
|
+
targetRequired?: string;
|
|
823
|
+
targetMin?: string;
|
|
824
|
+
targetMax?: string;
|
|
825
|
+
spendLimitFieldPrefix?: string;
|
|
826
|
+
spendLimitFieldSuffix?: string;
|
|
827
|
+
spendLimitFieldPlaceholder?: string;
|
|
828
|
+
spendLimitHelpText?: string;
|
|
829
|
+
spendLimitPeriod?: string;
|
|
830
|
+
spendLimitPositive?: string;
|
|
831
|
+
spendLimitMin?: string;
|
|
832
|
+
spendLimitMax?: string;
|
|
833
|
+
immediateRechargeWarning?: string;
|
|
834
|
+
spendLimitTooLowWarning?: string;
|
|
835
|
+
cancelButton?: string;
|
|
836
|
+
saveButton?: string;
|
|
837
|
+
editButton?: string;
|
|
838
|
+
loadingState?: string;
|
|
839
|
+
errorState?: string;
|
|
840
|
+
emptyState?: string;
|
|
841
|
+
}
|
|
842
|
+
interface AutomaticRechargeFormData {
|
|
843
|
+
enabled: boolean;
|
|
844
|
+
thresholdAmount: string;
|
|
845
|
+
targetBalance: string;
|
|
846
|
+
maxSpendLimit: string;
|
|
847
|
+
}
|
|
848
|
+
interface AutomaticRechargeFormErrors {
|
|
849
|
+
thresholdAmount?: string;
|
|
850
|
+
targetBalance?: string;
|
|
851
|
+
maxSpendLimit?: string;
|
|
852
|
+
}
|
|
853
|
+
interface AutomaticRechargeConfigFormProps {
|
|
854
|
+
customerId: string;
|
|
855
|
+
currencyId: string;
|
|
856
|
+
currencyUnit?: string;
|
|
857
|
+
poolSize?: number;
|
|
858
|
+
currentBalance?: number;
|
|
859
|
+
currentMonthlySpend?: number;
|
|
860
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
861
|
+
readOnly?: boolean;
|
|
862
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
863
|
+
onCancel?: () => void;
|
|
864
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
interface AutomaticRechargeConfigProps {
|
|
868
|
+
customerId: string;
|
|
869
|
+
currencyId: string;
|
|
870
|
+
currencyUnit?: string;
|
|
871
|
+
poolSize?: number;
|
|
872
|
+
readOnly?: boolean;
|
|
873
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
874
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
875
|
+
onCancel?: () => void;
|
|
876
|
+
}
|
|
877
|
+
declare function AutomaticRechargeConfig({ customerId, currencyId, currencyUnit, poolSize, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigProps): JSX.Element;
|
|
878
|
+
|
|
879
|
+
declare function AutomaticRechargeConfigForm({ customerId, currencyId, initialData, currencyUnit, poolSize, currentBalance, currentMonthlySpend, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigFormProps): JSX.Element;
|
|
880
|
+
|
|
881
|
+
interface UseAutomaticRechargeFormProps {
|
|
882
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
883
|
+
poolSize?: number;
|
|
884
|
+
localization: Required<AutomaticRechargeConfigLocalization>;
|
|
885
|
+
}
|
|
886
|
+
declare function useAutomaticRechargeForm({ initialData, poolSize, localization }: UseAutomaticRechargeFormProps): {
|
|
887
|
+
formData: AutomaticRechargeFormData;
|
|
888
|
+
errors: AutomaticRechargeFormErrors;
|
|
889
|
+
touched: {
|
|
890
|
+
[key: string]: boolean;
|
|
891
|
+
};
|
|
892
|
+
handleEnabledChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
893
|
+
handleFieldChange: (field: keyof AutomaticRechargeFormData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
894
|
+
handleFieldBlur: (field: keyof AutomaticRechargeFormData) => () => void;
|
|
895
|
+
getFieldError: (field: keyof AutomaticRechargeFormErrors) => string | undefined;
|
|
896
|
+
validate: () => boolean;
|
|
897
|
+
getFormValues: () => {
|
|
898
|
+
enabled: boolean;
|
|
899
|
+
thresholdAmount: number | undefined;
|
|
900
|
+
targetBalance: number | undefined;
|
|
901
|
+
maxSpendLimit: number | undefined;
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
interface ValidationRules {
|
|
906
|
+
poolSize?: number;
|
|
907
|
+
minSpendLimit?: number;
|
|
908
|
+
maxSpendLimit?: number;
|
|
909
|
+
}
|
|
910
|
+
declare function validateAutomaticRechargeForm(data: AutomaticRechargeFormData, rules: ValidationRules | undefined, localization: Pick<AutomaticRechargeConfigLocalization, 'thresholdRequired' | 'thresholdMin' | 'thresholdMax' | 'targetRequired' | 'targetMin' | 'targetMax' | 'spendLimitPositive' | 'spendLimitMin' | 'spendLimitMax'>): AutomaticRechargeFormErrors;
|
|
911
|
+
|
|
764
912
|
type TableAlignment = 'left' | 'center' | 'right';
|
|
765
913
|
type PixelWidth = `${number}px`;
|
|
766
914
|
interface HeadCell<T> {
|
|
@@ -833,4 +981,4 @@ declare function StatusChip({ variant, label, className, size, ...props }: Statu
|
|
|
833
981
|
|
|
834
982
|
declare const mapCreditGrantStatusToVariant: (status: CreditGrantStatus) => StatusChipVariant;
|
|
835
983
|
|
|
836
|
-
export { AddonsList, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted };
|
|
984
|
+
export { AddonsList, AutoRechargeStatus, type AutoRechargeStatusLocalization, type AutoRechargeStatusProps, AutomaticRechargeConfig, AutomaticRechargeConfigForm, type AutomaticRechargeConfigFormProps, type AutomaticRechargeConfigLocalization, type AutomaticRechargeConfigProps, type AutomaticRechargeConfiguration, type AutomaticRechargeFormData, type AutomaticRechargeFormErrors, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, type UpdateAutomaticRechargeConfigParams, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useAutomaticRechargeForm, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted, validateAutomaticRechargeForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _stigg_js_client_sdk from '@stigg/js-client-sdk';
|
|
|
2
2
|
import { Plan, Customer, Subscription, BillingPeriod, BillableFeature, CustomerPortalSubscriptionScheduledUpdateDataFragment, PaywallCurrency, PaywallCalculatedPricePoint, PriceTierFragment, Price, CustomerPortalSubscription, CustomerPortalEntitlement, EntitlementsFallback, SubscriptionAddon, Addon, BillingAddress, SubscriptionBillingInfo, GetCheckoutState, GetCheckoutStateResults, ApplySubscription, ApplySubscriptionResults, CheckoutStatePlan, PreviewSubscription, SubscriptionPreviewV2, SubscriptionPreviewDiscount, SubscriptionPreviewTaxDetails, GetBooleanEntitlement, BooleanEntitlement, GetNumericEntitlement, NumericEntitlement, GetMeteredEntitlement, MeteredEntitlement, GetEnumEntitlement, EnumEntitlement, GetActiveSubscriptions, GetPaywall, GetCustomerPortal, CreditUsageTimeRange, GetCreditUsageInput, CursorPaging, CreditGrantFragment, PageInfoFragment } from '@stigg/js-client-sdk';
|
|
3
3
|
export * from '@stigg/js-client-sdk';
|
|
4
4
|
import { FeatureFragment, BillingPeriod as BillingPeriod$1, BillableFeatureInput } from '@stigg/api-client-js/src/generated/sdk';
|
|
5
|
-
import react, { PropsWithChildren, ReactNode } from 'react';
|
|
5
|
+
import react, { PropsWithChildren, ChangeEvent, ReactNode } from 'react';
|
|
6
6
|
import { ChipProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
type DeepPartial<T> = T extends object ? {
|
|
@@ -724,7 +724,7 @@ type CreditUtilizationLocalization = {
|
|
|
724
724
|
};
|
|
725
725
|
declare function CreditUtilization({ currencyId, localization, decimalPlaces, showUnits, showSymbol, }: CreditUtilizationProps): JSX.Element;
|
|
726
726
|
|
|
727
|
-
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt'>;
|
|
727
|
+
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt' | 'automaticRechargeConfigurationId'>;
|
|
728
728
|
declare enum CreditGrantStatus {
|
|
729
729
|
SCHEDULED = "SCHEDULED",
|
|
730
730
|
AVAILABLE = "AVAILABLE",
|
|
@@ -761,6 +761,154 @@ declare function useCreditGrants(params: GetCreditGrantsParams): {
|
|
|
761
761
|
totalCount?: number;
|
|
762
762
|
};
|
|
763
763
|
|
|
764
|
+
interface AutoRechargeStatusLocalization {
|
|
765
|
+
title?: string;
|
|
766
|
+
activeLabel?: string;
|
|
767
|
+
manageButton?: string;
|
|
768
|
+
descriptionTemplate?: string;
|
|
769
|
+
emptyStateMessage?: string;
|
|
770
|
+
spendTemplate?: string;
|
|
771
|
+
unlimitedSpendLimit?: string;
|
|
772
|
+
}
|
|
773
|
+
interface AutoRechargeStatusContentProps {
|
|
774
|
+
customerId: string;
|
|
775
|
+
currencyId: string;
|
|
776
|
+
currencyUnit?: string;
|
|
777
|
+
billingCurrency?: string;
|
|
778
|
+
onManageClick?: () => void;
|
|
779
|
+
className?: string;
|
|
780
|
+
localization?: AutoRechargeStatusLocalization;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
type AutoRechargeStatusProps = AutoRechargeStatusContentProps;
|
|
784
|
+
|
|
785
|
+
declare function AutoRechargeStatus(props: AutoRechargeStatusProps): JSX.Element;
|
|
786
|
+
|
|
787
|
+
interface AutomaticRechargeConfiguration {
|
|
788
|
+
id: string;
|
|
789
|
+
enabled: boolean;
|
|
790
|
+
thresholdAmount: number;
|
|
791
|
+
targetBalance: number;
|
|
792
|
+
maxSpendLimit?: number;
|
|
793
|
+
currencyId: string;
|
|
794
|
+
customerId: string;
|
|
795
|
+
currentMonthlySpend?: number;
|
|
796
|
+
}
|
|
797
|
+
interface UpdateAutomaticRechargeConfigParams {
|
|
798
|
+
customerId: string;
|
|
799
|
+
currencyId: string;
|
|
800
|
+
enabled: boolean;
|
|
801
|
+
thresholdAmount?: number;
|
|
802
|
+
targetBalance?: number;
|
|
803
|
+
maxSpendLimit?: number;
|
|
804
|
+
}
|
|
805
|
+
interface AutomaticRechargeConfigLocalization {
|
|
806
|
+
title?: string;
|
|
807
|
+
enableLabel?: string;
|
|
808
|
+
enableDescription?: string;
|
|
809
|
+
thresholdFieldPrefix?: string;
|
|
810
|
+
thresholdFieldSuffix?: string;
|
|
811
|
+
thresholdTooltip?: string;
|
|
812
|
+
thresholdFieldPlaceholder?: string;
|
|
813
|
+
thresholdFieldHint?: string;
|
|
814
|
+
thresholdRequired?: string;
|
|
815
|
+
thresholdMin?: string;
|
|
816
|
+
thresholdMax?: string;
|
|
817
|
+
targetFieldPrefix?: string;
|
|
818
|
+
targetFieldSuffix?: string;
|
|
819
|
+
targetBalanceTooltip?: string;
|
|
820
|
+
targetFieldPlaceholder?: string;
|
|
821
|
+
targetFieldHint?: string;
|
|
822
|
+
targetRequired?: string;
|
|
823
|
+
targetMin?: string;
|
|
824
|
+
targetMax?: string;
|
|
825
|
+
spendLimitFieldPrefix?: string;
|
|
826
|
+
spendLimitFieldSuffix?: string;
|
|
827
|
+
spendLimitFieldPlaceholder?: string;
|
|
828
|
+
spendLimitHelpText?: string;
|
|
829
|
+
spendLimitPeriod?: string;
|
|
830
|
+
spendLimitPositive?: string;
|
|
831
|
+
spendLimitMin?: string;
|
|
832
|
+
spendLimitMax?: string;
|
|
833
|
+
immediateRechargeWarning?: string;
|
|
834
|
+
spendLimitTooLowWarning?: string;
|
|
835
|
+
cancelButton?: string;
|
|
836
|
+
saveButton?: string;
|
|
837
|
+
editButton?: string;
|
|
838
|
+
loadingState?: string;
|
|
839
|
+
errorState?: string;
|
|
840
|
+
emptyState?: string;
|
|
841
|
+
}
|
|
842
|
+
interface AutomaticRechargeFormData {
|
|
843
|
+
enabled: boolean;
|
|
844
|
+
thresholdAmount: string;
|
|
845
|
+
targetBalance: string;
|
|
846
|
+
maxSpendLimit: string;
|
|
847
|
+
}
|
|
848
|
+
interface AutomaticRechargeFormErrors {
|
|
849
|
+
thresholdAmount?: string;
|
|
850
|
+
targetBalance?: string;
|
|
851
|
+
maxSpendLimit?: string;
|
|
852
|
+
}
|
|
853
|
+
interface AutomaticRechargeConfigFormProps {
|
|
854
|
+
customerId: string;
|
|
855
|
+
currencyId: string;
|
|
856
|
+
currencyUnit?: string;
|
|
857
|
+
poolSize?: number;
|
|
858
|
+
currentBalance?: number;
|
|
859
|
+
currentMonthlySpend?: number;
|
|
860
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
861
|
+
readOnly?: boolean;
|
|
862
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
863
|
+
onCancel?: () => void;
|
|
864
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
interface AutomaticRechargeConfigProps {
|
|
868
|
+
customerId: string;
|
|
869
|
+
currencyId: string;
|
|
870
|
+
currencyUnit?: string;
|
|
871
|
+
poolSize?: number;
|
|
872
|
+
readOnly?: boolean;
|
|
873
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
874
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
875
|
+
onCancel?: () => void;
|
|
876
|
+
}
|
|
877
|
+
declare function AutomaticRechargeConfig({ customerId, currencyId, currencyUnit, poolSize, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigProps): JSX.Element;
|
|
878
|
+
|
|
879
|
+
declare function AutomaticRechargeConfigForm({ customerId, currencyId, initialData, currencyUnit, poolSize, currentBalance, currentMonthlySpend, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigFormProps): JSX.Element;
|
|
880
|
+
|
|
881
|
+
interface UseAutomaticRechargeFormProps {
|
|
882
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
883
|
+
poolSize?: number;
|
|
884
|
+
localization: Required<AutomaticRechargeConfigLocalization>;
|
|
885
|
+
}
|
|
886
|
+
declare function useAutomaticRechargeForm({ initialData, poolSize, localization }: UseAutomaticRechargeFormProps): {
|
|
887
|
+
formData: AutomaticRechargeFormData;
|
|
888
|
+
errors: AutomaticRechargeFormErrors;
|
|
889
|
+
touched: {
|
|
890
|
+
[key: string]: boolean;
|
|
891
|
+
};
|
|
892
|
+
handleEnabledChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
893
|
+
handleFieldChange: (field: keyof AutomaticRechargeFormData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
894
|
+
handleFieldBlur: (field: keyof AutomaticRechargeFormData) => () => void;
|
|
895
|
+
getFieldError: (field: keyof AutomaticRechargeFormErrors) => string | undefined;
|
|
896
|
+
validate: () => boolean;
|
|
897
|
+
getFormValues: () => {
|
|
898
|
+
enabled: boolean;
|
|
899
|
+
thresholdAmount: number | undefined;
|
|
900
|
+
targetBalance: number | undefined;
|
|
901
|
+
maxSpendLimit: number | undefined;
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
interface ValidationRules {
|
|
906
|
+
poolSize?: number;
|
|
907
|
+
minSpendLimit?: number;
|
|
908
|
+
maxSpendLimit?: number;
|
|
909
|
+
}
|
|
910
|
+
declare function validateAutomaticRechargeForm(data: AutomaticRechargeFormData, rules: ValidationRules | undefined, localization: Pick<AutomaticRechargeConfigLocalization, 'thresholdRequired' | 'thresholdMin' | 'thresholdMax' | 'targetRequired' | 'targetMin' | 'targetMax' | 'spendLimitPositive' | 'spendLimitMin' | 'spendLimitMax'>): AutomaticRechargeFormErrors;
|
|
911
|
+
|
|
764
912
|
type TableAlignment = 'left' | 'center' | 'right';
|
|
765
913
|
type PixelWidth = `${number}px`;
|
|
766
914
|
interface HeadCell<T> {
|
|
@@ -833,4 +981,4 @@ declare function StatusChip({ variant, label, className, size, ...props }: Statu
|
|
|
833
981
|
|
|
834
982
|
declare const mapCreditGrantStatusToVariant: (status: CreditGrantStatus) => StatusChipVariant;
|
|
835
983
|
|
|
836
|
-
export { AddonsList, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted };
|
|
984
|
+
export { AddonsList, AutoRechargeStatus, type AutoRechargeStatusLocalization, type AutoRechargeStatusProps, AutomaticRechargeConfig, AutomaticRechargeConfigForm, type AutomaticRechargeConfigFormProps, type AutomaticRechargeConfigLocalization, type AutomaticRechargeConfigProps, type AutomaticRechargeConfiguration, type AutomaticRechargeFormData, type AutomaticRechargeFormErrors, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, type UpdateAutomaticRechargeConfigParams, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useAutomaticRechargeForm, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted, validateAutomaticRechargeForm };
|