@solvapay/react 1.3.0 → 1.4.0-preview-ecd61384a4e849717e13d47ab2daa086cdcd91c5

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.
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
@@ -14,7 +14,7 @@ import {
14
14
  usePurchaseStatus,
15
15
  useSolvaPay,
16
16
  useTransport
17
- } from "./chunk-DW5FJUUG.js";
17
+ } from "./chunk-6RR4J74H.js";
18
18
 
19
19
  // src/components/CancelledPlanNotice.tsx
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-lIhc8DS3.js';
1
+ import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-LcjvX4fD.cjs';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -458,6 +458,25 @@ declare const CancelPlanButton: React.ForwardRefExoticComponent<React.ButtonHTML
458
458
  onError?: (error: Error) => void;
459
459
  } & React.RefAttributes<HTMLButtonElement>>;
460
460
 
461
+ type AmountInputUnit = 'currency' | 'credits';
462
+ type AutoRechargeFormState = {
463
+ enabled: boolean;
464
+ thresholdAmountMajor: string;
465
+ thresholdUnit: AmountInputUnit;
466
+ thresholdBaseValue: string;
467
+ thresholdBaseUnit: AmountInputUnit;
468
+ topupAmountMajor: string;
469
+ topupUnit: AmountInputUnit;
470
+ topupBaseValue: string;
471
+ topupBaseUnit: AmountInputUnit;
472
+ };
473
+ type AutoRechargeInputPayload = AutoRechargeInput;
474
+ /** Map a persisted config back to a payment-intent auto-recharge payload. */
475
+ declare function configToAutoRechargeInput(config: AutoRechargeConfig, options?: {
476
+ display?: AutoRechargeDisplayBlock | null;
477
+ currency?: string;
478
+ }): AutoRechargeInput | null;
479
+
461
480
  interface UseUsageReturn {
462
481
  /** Raw usage snapshot (`null` when no usage-based plan is active). */
463
482
  usage: UsageSnapshot | null;
@@ -718,4 +737,4 @@ declare const CheckoutStepsBackLink: React.ForwardRefExoticComponent<Omit<React.
718
737
  } & React.RefAttributes<HTMLButtonElement>>;
719
738
  declare const CheckoutStepsSuccess: typeof Success;
720
739
 
721
- export { CheckoutStepsSuccess as $, type ActivationFlowStep as A, BalanceBadge as B, type CheckoutVariant as C, useUsage as D, ActivationFlow as E, ActivationFlowActivateButton as F, ActivationFlowActivated as G, ActivationFlowAmountPicker as H, ActivationFlowContinueButton as I, ActivationFlowError as J, ActivationFlowLoading as K, ActivationFlowRetrying as L, MandateText as M, ActivationFlowRoot as N, ActivationFlowSummary as O, PaymentFormSummary as P, CheckoutStepsAmountContinueButton as Q, CheckoutStepsAmountPicker as R, CheckoutStepsBackLink as S, CheckoutStepsIfStep as T, type UsageSnapshot as U, CheckoutStepsPayment as V, CheckoutStepsPlanContinueButton as W, CheckoutStepsPlanGrid as X, CheckoutStepsRoot as Y, CheckoutStepsStepHeading as Z, CheckoutStepsStepMessage as _, PaymentFormCustomerFields as a, PaymentForm as a0, PaymentFormRoot as a1, PurchaseGateAllowed as a2, PurchaseGateBlocked as a3, PurchaseGateError as a4, PurchaseGateLoading as a5, PurchaseGateRoot as a6, useActivationFlow as a7, usePurchaseGate as a8, PaymentFormPaymentElement as b, PaymentFormCardElement as c, PaymentFormMandateText as d, PaymentFormTermsCheckbox as e, PaymentFormSubmitButton as f, PaymentFormLoading as g, PaymentFormError as h, PaymentFormLegalFooter as i, type PaywallStructuredContent as j, CancelPlanButton as k, type CheckoutErrorPhase as l, type CheckoutStatus as m, CheckoutSteps as n, CheckoutSummary as o, type CheckoutSummaryProps as p, type MandateTextProps as q, PlanBadge as r, ProductBadge as s, PurchaseGate as t, type UseCheckoutFlowOptions as u, type UseCheckoutFlowReturn as v, type UseUsageReturn as w, deriveVariant as x, useCheckoutFlow as y, useCheckoutSteps as z };
740
+ export { CheckoutStepsPlanGrid as $, type AutoRechargeInputPayload as A, BalanceBadge as B, type CheckoutVariant as C, useCheckoutFlow as D, useCheckoutSteps as E, useUsage as F, type AmountInputUnit as G, type AutoRechargeFormState as H, ActivationFlow as I, ActivationFlowActivateButton as J, ActivationFlowActivated as K, ActivationFlowAmountPicker as L, MandateText as M, ActivationFlowContinueButton as N, ActivationFlowError as O, PaymentFormSummary as P, ActivationFlowLoading as Q, ActivationFlowRetrying as R, ActivationFlowRoot as S, ActivationFlowSummary as T, type UsageSnapshot as U, CheckoutStepsAmountContinueButton as V, CheckoutStepsAmountPicker as W, CheckoutStepsBackLink as X, CheckoutStepsIfStep as Y, CheckoutStepsPayment as Z, CheckoutStepsPlanContinueButton as _, PaymentFormCustomerFields as a, CheckoutStepsRoot as a0, CheckoutStepsStepHeading as a1, CheckoutStepsStepMessage as a2, CheckoutStepsSuccess as a3, PaymentForm as a4, PaymentFormRoot as a5, PurchaseGateAllowed as a6, PurchaseGateBlocked as a7, PurchaseGateError as a8, PurchaseGateLoading as a9, PurchaseGateRoot as aa, useActivationFlow as ab, usePurchaseGate as ac, PaymentFormPaymentElement as b, PaymentFormCardElement as c, PaymentFormMandateText as d, PaymentFormTermsCheckbox as e, PaymentFormSubmitButton as f, PaymentFormLoading as g, PaymentFormError as h, PaymentFormLegalFooter as i, type PaywallStructuredContent as j, type ActivationFlowStep as k, CancelPlanButton as l, type CheckoutErrorPhase as m, type CheckoutStatus as n, CheckoutSteps as o, CheckoutSummary as p, type CheckoutSummaryProps as q, type MandateTextProps as r, PlanBadge as s, ProductBadge as t, PurchaseGate as u, type UseCheckoutFlowOptions as v, type UseCheckoutFlowReturn as w, type UseUsageReturn as x, configToAutoRechargeInput as y, deriveVariant as z };
@@ -1,4 +1,4 @@
1
- import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-BNZAIWkU.cjs';
1
+ import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-D8raw1Nv.js';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -458,6 +458,25 @@ declare const CancelPlanButton: React.ForwardRefExoticComponent<React.ButtonHTML
458
458
  onError?: (error: Error) => void;
459
459
  } & React.RefAttributes<HTMLButtonElement>>;
460
460
 
461
+ type AmountInputUnit = 'currency' | 'credits';
462
+ type AutoRechargeFormState = {
463
+ enabled: boolean;
464
+ thresholdAmountMajor: string;
465
+ thresholdUnit: AmountInputUnit;
466
+ thresholdBaseValue: string;
467
+ thresholdBaseUnit: AmountInputUnit;
468
+ topupAmountMajor: string;
469
+ topupUnit: AmountInputUnit;
470
+ topupBaseValue: string;
471
+ topupBaseUnit: AmountInputUnit;
472
+ };
473
+ type AutoRechargeInputPayload = AutoRechargeInput;
474
+ /** Map a persisted config back to a payment-intent auto-recharge payload. */
475
+ declare function configToAutoRechargeInput(config: AutoRechargeConfig, options?: {
476
+ display?: AutoRechargeDisplayBlock | null;
477
+ currency?: string;
478
+ }): AutoRechargeInput | null;
479
+
461
480
  interface UseUsageReturn {
462
481
  /** Raw usage snapshot (`null` when no usage-based plan is active). */
463
482
  usage: UsageSnapshot | null;
@@ -718,4 +737,4 @@ declare const CheckoutStepsBackLink: React.ForwardRefExoticComponent<Omit<React.
718
737
  } & React.RefAttributes<HTMLButtonElement>>;
719
738
  declare const CheckoutStepsSuccess: typeof Success;
720
739
 
721
- export { CheckoutStepsSuccess as $, type ActivationFlowStep as A, BalanceBadge as B, type CheckoutVariant as C, useUsage as D, ActivationFlow as E, ActivationFlowActivateButton as F, ActivationFlowActivated as G, ActivationFlowAmountPicker as H, ActivationFlowContinueButton as I, ActivationFlowError as J, ActivationFlowLoading as K, ActivationFlowRetrying as L, MandateText as M, ActivationFlowRoot as N, ActivationFlowSummary as O, PaymentFormSummary as P, CheckoutStepsAmountContinueButton as Q, CheckoutStepsAmountPicker as R, CheckoutStepsBackLink as S, CheckoutStepsIfStep as T, type UsageSnapshot as U, CheckoutStepsPayment as V, CheckoutStepsPlanContinueButton as W, CheckoutStepsPlanGrid as X, CheckoutStepsRoot as Y, CheckoutStepsStepHeading as Z, CheckoutStepsStepMessage as _, PaymentFormCustomerFields as a, PaymentForm as a0, PaymentFormRoot as a1, PurchaseGateAllowed as a2, PurchaseGateBlocked as a3, PurchaseGateError as a4, PurchaseGateLoading as a5, PurchaseGateRoot as a6, useActivationFlow as a7, usePurchaseGate as a8, PaymentFormPaymentElement as b, PaymentFormCardElement as c, PaymentFormMandateText as d, PaymentFormTermsCheckbox as e, PaymentFormSubmitButton as f, PaymentFormLoading as g, PaymentFormError as h, PaymentFormLegalFooter as i, type PaywallStructuredContent as j, CancelPlanButton as k, type CheckoutErrorPhase as l, type CheckoutStatus as m, CheckoutSteps as n, CheckoutSummary as o, type CheckoutSummaryProps as p, type MandateTextProps as q, PlanBadge as r, ProductBadge as s, PurchaseGate as t, type UseCheckoutFlowOptions as u, type UseCheckoutFlowReturn as v, type UseUsageReturn as w, deriveVariant as x, useCheckoutFlow as y, useCheckoutSteps as z };
740
+ export { CheckoutStepsPlanGrid as $, type AutoRechargeInputPayload as A, BalanceBadge as B, type CheckoutVariant as C, useCheckoutFlow as D, useCheckoutSteps as E, useUsage as F, type AmountInputUnit as G, type AutoRechargeFormState as H, ActivationFlow as I, ActivationFlowActivateButton as J, ActivationFlowActivated as K, ActivationFlowAmountPicker as L, MandateText as M, ActivationFlowContinueButton as N, ActivationFlowError as O, PaymentFormSummary as P, ActivationFlowLoading as Q, ActivationFlowRetrying as R, ActivationFlowRoot as S, ActivationFlowSummary as T, type UsageSnapshot as U, CheckoutStepsAmountContinueButton as V, CheckoutStepsAmountPicker as W, CheckoutStepsBackLink as X, CheckoutStepsIfStep as Y, CheckoutStepsPayment as Z, CheckoutStepsPlanContinueButton as _, PaymentFormCustomerFields as a, CheckoutStepsRoot as a0, CheckoutStepsStepHeading as a1, CheckoutStepsStepMessage as a2, CheckoutStepsSuccess as a3, PaymentForm as a4, PaymentFormRoot as a5, PurchaseGateAllowed as a6, PurchaseGateBlocked as a7, PurchaseGateError as a8, PurchaseGateLoading as a9, PurchaseGateRoot as aa, useActivationFlow as ab, usePurchaseGate as ac, PaymentFormPaymentElement as b, PaymentFormCardElement as c, PaymentFormMandateText as d, PaymentFormTermsCheckbox as e, PaymentFormSubmitButton as f, PaymentFormLoading as g, PaymentFormError as h, PaymentFormLegalFooter as i, type PaywallStructuredContent as j, type ActivationFlowStep as k, CancelPlanButton as l, type CheckoutErrorPhase as m, type CheckoutStatus as n, CheckoutSteps as o, CheckoutSummary as p, type CheckoutSummaryProps as q, type MandateTextProps as r, PlanBadge as s, ProductBadge as t, PurchaseGate as u, type UseCheckoutFlowOptions as v, type UseCheckoutFlowReturn as w, type UseUsageReturn as x, configToAutoRechargeInput as y, deriveVariant as z };