@subscrypts/subscrypts-sdk-react 1.6.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/LICENSE +21 -0
- package/README.md +2140 -0
- package/dist/components/buttons/SubscryptsButton.d.ts +19 -0
- package/dist/components/buttons/SubscryptsButton.d.ts.map +1 -0
- package/dist/components/buttons/index.d.ts +5 -0
- package/dist/components/buttons/index.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutWizard.d.ts +22 -0
- package/dist/components/checkout/CheckoutWizard.d.ts.map +1 -0
- package/dist/components/checkout/ConfigurationStep.d.ts +15 -0
- package/dist/components/checkout/ConfigurationStep.d.ts.map +1 -0
- package/dist/components/checkout/TransactionStep.d.ts +15 -0
- package/dist/components/checkout/TransactionStep.d.ts.map +1 -0
- package/dist/components/checkout/index.d.ts +7 -0
- package/dist/components/checkout/index.d.ts.map +1 -0
- package/dist/components/guards/SubscriptionGuard.d.ts +25 -0
- package/dist/components/guards/SubscriptionGuard.d.ts.map +1 -0
- package/dist/components/guards/index.d.ts +5 -0
- package/dist/components/guards/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/merchant/MerchantDashboard.d.ts +24 -0
- package/dist/components/merchant/MerchantDashboard.d.ts.map +1 -0
- package/dist/components/merchant/index.d.ts +6 -0
- package/dist/components/merchant/index.d.ts.map +1 -0
- package/dist/components/pricing/PlanCard.d.ts +45 -0
- package/dist/components/pricing/PlanCard.d.ts.map +1 -0
- package/dist/components/pricing/PricingTable.d.ts +68 -0
- package/dist/components/pricing/PricingTable.d.ts.map +1 -0
- package/dist/components/pricing/index.d.ts +10 -0
- package/dist/components/pricing/index.d.ts.map +1 -0
- package/dist/components/shared/ErrorDisplay.d.ts +34 -0
- package/dist/components/shared/ErrorDisplay.d.ts.map +1 -0
- package/dist/components/shared/LoadingSpinner.d.ts +5 -0
- package/dist/components/shared/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/shared/Modal.d.ts +12 -0
- package/dist/components/shared/Modal.d.ts.map +1 -0
- package/dist/components/shared/NetworkSwitchPrompt.d.ts +33 -0
- package/dist/components/shared/NetworkSwitchPrompt.d.ts.map +1 -0
- package/dist/components/shared/SubscryptsErrorBoundary.d.ts +41 -0
- package/dist/components/shared/SubscryptsErrorBoundary.d.ts.map +1 -0
- package/dist/components/subscription/ConfirmDialog.d.ts +44 -0
- package/dist/components/subscription/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/subscription/ManageSubscriptionModal.d.ts +35 -0
- package/dist/components/subscription/ManageSubscriptionModal.d.ts.map +1 -0
- package/dist/components/subscription/SubscriptionCard.d.ts +35 -0
- package/dist/components/subscription/SubscriptionCard.d.ts.map +1 -0
- package/dist/components/subscription/SubscriptionDashboard.d.ts +40 -0
- package/dist/components/subscription/SubscriptionDashboard.d.ts.map +1 -0
- package/dist/components/subscription/index.d.ts +12 -0
- package/dist/components/subscription/index.d.ts.map +1 -0
- package/dist/components/wallet/ConnectWalletModal.d.ts +29 -0
- package/dist/components/wallet/ConnectWalletModal.d.ts.map +1 -0
- package/dist/components/wallet/index.d.ts +6 -0
- package/dist/components/wallet/index.d.ts.map +1 -0
- package/dist/constants/index.d.ts +16 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/context/SubscryptsContext.d.ts +36 -0
- package/dist/context/SubscryptsContext.d.ts.map +1 -0
- package/dist/context/SubscryptsProvider.d.ts +28 -0
- package/dist/context/SubscryptsProvider.d.ts.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/contract/abis/Subscrypts.d.ts +2917 -0
- package/dist/contract/abis/Subscrypts.d.ts.map +1 -0
- package/dist/contract/abis/dexFactoryABI.d.ts +184 -0
- package/dist/contract/abis/dexFactoryABI.d.ts.map +1 -0
- package/dist/contract/abis/dexPairABI.d.ts +775 -0
- package/dist/contract/abis/dexPairABI.d.ts.map +1 -0
- package/dist/contract/abis/dexPositionManagerABI.d.ts +948 -0
- package/dist/contract/abis/dexPositionManagerABI.d.ts.map +1 -0
- package/dist/contract/abis/dexQuoterABI.d.ts +206 -0
- package/dist/contract/abis/dexQuoterABI.d.ts.map +1 -0
- package/dist/contract/abis/dexRouterABI.d.ts +439 -0
- package/dist/contract/abis/dexRouterABI.d.ts.map +1 -0
- package/dist/contract/abis/dexUSDCABI.d.ts +132 -0
- package/dist/contract/abis/dexUSDCABI.d.ts.map +1 -0
- package/dist/contract/abis/index.d.ts +15 -0
- package/dist/contract/abis/index.d.ts.map +1 -0
- package/dist/contract/config.d.ts +40 -0
- package/dist/contract/config.d.ts.map +1 -0
- package/dist/contract/index.d.ts +12 -0
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/methods.d.ts +305 -0
- package/dist/contract/methods.d.ts.map +1 -0
- package/dist/hooks/events/index.d.ts +6 -0
- package/dist/hooks/events/index.d.ts.map +1 -0
- package/dist/hooks/events/useSubscryptsEvents.d.ts +63 -0
- package/dist/hooks/events/useSubscryptsEvents.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/merchant/index.d.ts +10 -0
- package/dist/hooks/merchant/index.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantPlans.d.ts +30 -0
- package/dist/hooks/merchant/useMerchantPlans.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantRevenue.d.ts +59 -0
- package/dist/hooks/merchant/useMerchantRevenue.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantSubscribers.d.ts +54 -0
- package/dist/hooks/merchant/useMerchantSubscribers.d.ts.map +1 -0
- package/dist/hooks/plans/index.d.ts +12 -0
- package/dist/hooks/plans/index.d.ts.map +1 -0
- package/dist/hooks/plans/usePlan.d.ts +33 -0
- package/dist/hooks/plans/usePlan.d.ts.map +1 -0
- package/dist/hooks/plans/usePlans.d.ts +36 -0
- package/dist/hooks/plans/usePlans.d.ts.map +1 -0
- package/dist/hooks/plans/usePlansByMerchant.d.ts +35 -0
- package/dist/hooks/plans/usePlansByMerchant.d.ts.map +1 -0
- package/dist/hooks/pricing/index.d.ts +10 -0
- package/dist/hooks/pricing/index.d.ts.map +1 -0
- package/dist/hooks/pricing/usePlanPrice.d.ts +59 -0
- package/dist/hooks/pricing/usePlanPrice.d.ts.map +1 -0
- package/dist/hooks/pricing/useSUBSPrice.d.ts +39 -0
- package/dist/hooks/pricing/useSUBSPrice.d.ts.map +1 -0
- package/dist/hooks/subscriptions/index.d.ts +12 -0
- package/dist/hooks/subscriptions/index.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useManageSubscription.d.ts +39 -0
- package/dist/hooks/subscriptions/useManageSubscription.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useMySubscriptions.d.ts +53 -0
- package/dist/hooks/subscriptions/useMySubscriptions.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useSubscribe.d.ts +58 -0
- package/dist/hooks/subscriptions/useSubscribe.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useSubscriptionStatus.d.ts +34 -0
- package/dist/hooks/subscriptions/useSubscriptionStatus.d.ts.map +1 -0
- package/dist/hooks/tokens/index.d.ts +6 -0
- package/dist/hooks/tokens/index.d.ts.map +1 -0
- package/dist/hooks/tokens/useTokenBalance.d.ts +36 -0
- package/dist/hooks/tokens/useTokenBalance.d.ts.map +1 -0
- package/dist/hooks/wallet/index.d.ts +6 -0
- package/dist/hooks/wallet/index.d.ts.map +1 -0
- package/dist/hooks/wallet/useWallet.d.ts +40 -0
- package/dist/hooks/wallet/useWallet.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7850 -0
- package/dist/index.js.map +1 -0
- package/dist/services/cache.service.d.ts +89 -0
- package/dist/services/cache.service.d.ts.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/token.service.d.ts +43 -0
- package/dist/services/token.service.d.ts.map +1 -0
- package/dist/services/wallet.service.d.ts +46 -0
- package/dist/services/wallet.service.d.ts.map +1 -0
- package/dist/style.css +3 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/types/component.types.d.ts +192 -0
- package/dist/types/component.types.d.ts.map +1 -0
- package/dist/types/contract.types.d.ts +81 -0
- package/dist/types/contract.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/subscription.types.d.ts +65 -0
- package/dist/types/subscription.types.d.ts.map +1 -0
- package/dist/types/wallet.types.d.ts +53 -0
- package/dist/types/wallet.types.d.ts.map +1 -0
- package/dist/utils/errorMessages.d.ts +44 -0
- package/dist/utils/errorMessages.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +60 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/formatters.d.ts +44 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +80 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/permit.utils.d.ts +52 -0
- package/dist/utils/permit.utils.d.ts.map +1 -0
- package/dist/utils/subscriptionHelpers.d.ts +67 -0
- package/dist/utils/subscriptionHelpers.d.ts.map +1 -0
- package/dist/utils/subscriptionStatus.d.ts +48 -0
- package/dist/utils/subscriptionStatus.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +76 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/wallet/ExternalConnector.d.ts +32 -0
- package/dist/wallet/ExternalConnector.d.ts.map +1 -0
- package/dist/wallet/InjectedConnector.d.ts +55 -0
- package/dist/wallet/InjectedConnector.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +9 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/sessionStore.d.ts +28 -0
- package/dist/wallet/sessionStore.d.ts.map +1 -0
- package/dist/wallet/types.d.ts +66 -0
- package/dist/wallet/types.d.ts.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SubscryptsButtonProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subscrypts Button Component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <SubscryptsButton
|
|
9
|
+
* planId="1"
|
|
10
|
+
* variant="primary"
|
|
11
|
+
* size="lg"
|
|
12
|
+
* onSuccess={(subId) => navigate('/dashboard')}
|
|
13
|
+
* >
|
|
14
|
+
* Subscribe Now
|
|
15
|
+
* </SubscryptsButton>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function SubscryptsButton({ planId, variant, size, children, referralAddress, onSuccess }: SubscryptsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=SubscryptsButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscryptsButton.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/SubscryptsButton.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,OAAmB,EACnB,IAAW,EACX,QAAQ,EACR,eAAe,EACf,SAAS,EACV,EAAE,qBAAqB,2CAqCvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CheckoutWizardProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checkout Wizard Component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
*
|
|
10
|
+
* <CheckoutWizard
|
|
11
|
+
* planId="1"
|
|
12
|
+
* isOpen={isOpen}
|
|
13
|
+
* onClose={() => setIsOpen(false)}
|
|
14
|
+
* onSuccess={(subId) => {
|
|
15
|
+
* console.log('Subscribed!', subId);
|
|
16
|
+
* setIsOpen(false);
|
|
17
|
+
* }}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function CheckoutWizard({ planId, isOpen, onClose, referralAddress, onSuccess, onError }: CheckoutWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=CheckoutWizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckoutWizard.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/CheckoutWizard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,mBAAmB,EAAiB,MAAM,aAAa,CAAC;AAMjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,MAAM,EACN,OAAO,EACP,eAAe,EACf,SAAS,EACT,OAAO,EACR,EAAE,mBAAmB,2CA8GrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaymentMethod } from '../../types';
|
|
2
|
+
|
|
3
|
+
interface ConfigurationStepProps {
|
|
4
|
+
cycleLimit: number;
|
|
5
|
+
onCycleLimitChange: (value: number) => void;
|
|
6
|
+
autoRenew: boolean;
|
|
7
|
+
onAutoRenewChange: (value: boolean) => void;
|
|
8
|
+
paymentMethod: PaymentMethod;
|
|
9
|
+
onPaymentMethodChange: (value: PaymentMethod) => void;
|
|
10
|
+
onNext: () => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function ConfigurationStep({ cycleLimit, onCycleLimitChange, autoRenew, onAutoRenewChange, paymentMethod, onPaymentMethodChange, onNext, onCancel }: ConfigurationStepProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=ConfigurationStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationStep.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/ConfigurationStep.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,UAAU,sBAAsB;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,aAAa,CAAC;IAC7B,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,MAAM,EACN,QAAQ,EACT,EAAE,sBAAsB,2CAuGxB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaymentMethod } from '../../types';
|
|
2
|
+
|
|
3
|
+
interface TransactionStepProps {
|
|
4
|
+
paymentMethod: PaymentMethod;
|
|
5
|
+
txState: 'idle' | 'approving' | 'waiting_approval' | 'subscribing' | 'waiting_subscribe' | 'success' | 'error';
|
|
6
|
+
error: Error | null;
|
|
7
|
+
subscriptionId: string | null;
|
|
8
|
+
txHash: string | null;
|
|
9
|
+
onExecute: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onBack: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function TransactionStep({ paymentMethod, txState, error, subscriptionId, txHash, onExecute, onClose, onBack }: TransactionStepProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=TransactionStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionStep.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/TransactionStep.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,UAAU,oBAAoB;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,kBAAkB,GAAG,aAAa,GAAG,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/G,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,OAAO,EACP,KAAK,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,MAAM,EACP,EAAE,oBAAoB,2CA0HtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SubscriptionGuardProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subscription Guard Component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* // Single plan (backward compatible)
|
|
9
|
+
* <SubscriptionGuard planId="1" fallbackUrl="/subscribe">
|
|
10
|
+
* <PremiumContent />
|
|
11
|
+
* </SubscriptionGuard>
|
|
12
|
+
*
|
|
13
|
+
* // Multi-plan: any of these plans grants access
|
|
14
|
+
* <SubscriptionGuard planIds={['1', '2', '3']}>
|
|
15
|
+
* <PremiumContent />
|
|
16
|
+
* </SubscriptionGuard>
|
|
17
|
+
*
|
|
18
|
+
* // Multi-plan: require ALL plans
|
|
19
|
+
* <SubscriptionGuard planIds={['1', '2']} requireAll>
|
|
20
|
+
* <BundleContent />
|
|
21
|
+
* </SubscriptionGuard>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function SubscriptionGuard({ planId, planIds, requireAll, fallbackUrl, loadingComponent, children, onAccessDenied }: SubscriptionGuardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
//# sourceMappingURL=SubscriptionGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionGuard.d.ts","sourceRoot":"","sources":["../../../src/components/guards/SubscriptionGuard.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAwFrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,OAAO,EACP,UAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACf,EAAE,sBAAsB,kDA+CxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/guards/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component exports for @subscrypts/subscrypts-sdk-react
|
|
3
|
+
*/
|
|
4
|
+
export * from './guards';
|
|
5
|
+
export * from './checkout';
|
|
6
|
+
export * from './buttons';
|
|
7
|
+
export * from './pricing';
|
|
8
|
+
export { LoadingSpinner } from './shared/LoadingSpinner';
|
|
9
|
+
export { Modal } from './shared/Modal';
|
|
10
|
+
export { ErrorDisplay } from './shared/ErrorDisplay';
|
|
11
|
+
export type { ErrorDisplayProps } from './shared/ErrorDisplay';
|
|
12
|
+
export { NetworkSwitchPrompt } from './shared/NetworkSwitchPrompt';
|
|
13
|
+
export type { NetworkSwitchPromptProps } from './shared/NetworkSwitchPrompt';
|
|
14
|
+
export { SubscryptsErrorBoundary } from './shared/SubscryptsErrorBoundary';
|
|
15
|
+
export type { SubscryptsErrorBoundaryProps } from './shared/SubscryptsErrorBoundary';
|
|
16
|
+
export { ConnectWalletModal } from './wallet/ConnectWalletModal';
|
|
17
|
+
export type { ConnectWalletModalProps } from './wallet/ConnectWalletModal';
|
|
18
|
+
export * from './subscription';
|
|
19
|
+
export * from './merchant';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAG3B,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,YAAY,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAGrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,cAAc,gBAAgB,CAAC;AAG/B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MerchantDashboard Component
|
|
3
|
+
*
|
|
4
|
+
* Complete merchant overview with revenue metrics, plan list, and subscriber stats.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* MerchantDashboard props
|
|
8
|
+
*/
|
|
9
|
+
export interface MerchantDashboardProps {
|
|
10
|
+
/** Merchant address (defaults to connected wallet) */
|
|
11
|
+
merchantAddress?: string;
|
|
12
|
+
/** Additional CSS class */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Complete merchant dashboard showing revenue, plans, and subscribers.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <MerchantDashboard />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function MerchantDashboard({ merchantAddress: _merchantAddress, className }: MerchantDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=MerchantDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MerchantDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/merchant/MerchantDashboard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,eAAe,EAAE,gBAAgB,EACjC,SAAc,EACf,EAAE,sBAAsB,2CAmNxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/merchant/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Plan } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Available fields that can be displayed on the plan card
|
|
5
|
+
*/
|
|
6
|
+
export type PlanField = 'description' | 'amount' | 'frequency' | 'subscribers' | 'merchant' | 'referralBonus' | 'attributes';
|
|
7
|
+
/**
|
|
8
|
+
* PlanCard props
|
|
9
|
+
*/
|
|
10
|
+
export interface PlanCardProps {
|
|
11
|
+
/** Plan data from smart contract */
|
|
12
|
+
plan: Plan;
|
|
13
|
+
/** Currency to display prices in (default: 'SUBS') */
|
|
14
|
+
currency?: 'SUBS' | 'USDC';
|
|
15
|
+
/** Fields to display on the card (default: description, amount, frequency) */
|
|
16
|
+
showFields?: PlanField[];
|
|
17
|
+
/** Callback when subscribe button is clicked */
|
|
18
|
+
onSubscribe?: (planId: string) => void;
|
|
19
|
+
/** Custom label for subscribe button */
|
|
20
|
+
subscribeLabel?: string;
|
|
21
|
+
/** Additional CSS class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Whether to show the subscribe button (default: true) */
|
|
24
|
+
showSubscribeButton?: boolean;
|
|
25
|
+
/** Whether the plan card is highlighted/featured */
|
|
26
|
+
featured?: boolean;
|
|
27
|
+
/** Custom header/title for the card */
|
|
28
|
+
title?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* PlanCard Component
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <PlanCard
|
|
36
|
+
* plan={plan}
|
|
37
|
+
* currency="SUBS"
|
|
38
|
+
* showFields={['description', 'amount', 'frequency', 'subscribers']}
|
|
39
|
+
* onSubscribe={(planId) => openCheckout(planId)}
|
|
40
|
+
* subscribeLabel="Get Started"
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function PlanCard({ plan, currency, showFields, onSubscribe, subscribeLabel, className, showSubscribeButton, featured, title }: PlanCardProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=PlanCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanCard.d.ts","sourceRoot":"","sources":["../../../src/components/pricing/PlanCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,QAAQ,GACR,WAAW,GACX,aAAa,GACb,UAAU,GACV,eAAe,GACf,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,gDAAgD;IAChD,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,wCAAwC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,QAAiB,EACjB,UAAmD,EACnD,WAAW,EACX,cAA4B,EAC5B,SAAc,EACd,mBAA0B,EAC1B,QAAgB,EAChB,KAAK,EACN,EAAE,aAAa,2CAkFf"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { PlanField } from './PlanCard';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for individual plan display
|
|
5
|
+
*/
|
|
6
|
+
export interface PlanConfig {
|
|
7
|
+
/** Plan ID */
|
|
8
|
+
planId: string;
|
|
9
|
+
/** Custom title for this plan */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Whether this plan is featured/highlighted */
|
|
12
|
+
featured?: boolean;
|
|
13
|
+
/** Custom subscribe button label */
|
|
14
|
+
subscribeLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* PricingTable props
|
|
18
|
+
*/
|
|
19
|
+
export interface PricingTableProps {
|
|
20
|
+
/** Array of plan IDs or plan configurations to display */
|
|
21
|
+
plans: (string | PlanConfig)[];
|
|
22
|
+
/** Currency to display prices in (default: 'SUBS') */
|
|
23
|
+
currency?: 'SUBS' | 'USDC';
|
|
24
|
+
/** Fields to display on each plan card */
|
|
25
|
+
showFields?: PlanField[];
|
|
26
|
+
/** Number of columns in the grid (1-4, default: auto based on count) */
|
|
27
|
+
columns?: 1 | 2 | 3 | 4;
|
|
28
|
+
/** Custom callback when subscribe is clicked (overrides built-in checkout) */
|
|
29
|
+
onSubscribe?: (planId: string) => void;
|
|
30
|
+
/** Default subscribe button label (can be overridden per-plan) */
|
|
31
|
+
subscribeLabel?: string;
|
|
32
|
+
/** Additional CSS class name */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Callback when subscription is successful */
|
|
35
|
+
onSubscriptionSuccess?: (subscriptionId: string, planId: string) => void;
|
|
36
|
+
/** Callback when subscription fails */
|
|
37
|
+
onSubscriptionError?: (error: Error, planId: string) => void;
|
|
38
|
+
/** Referral address for subscriptions */
|
|
39
|
+
referralAddress?: string;
|
|
40
|
+
/** Custom loading component */
|
|
41
|
+
loadingComponent?: React.ReactNode;
|
|
42
|
+
/** Custom error component */
|
|
43
|
+
errorComponent?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* PricingTable Component
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* // Simple usage with plan IDs
|
|
51
|
+
* <PricingTable
|
|
52
|
+
* plans={['1', '2', '3']}
|
|
53
|
+
* currency="SUBS"
|
|
54
|
+
* showFields={['description', 'amount', 'frequency', 'subscribers']}
|
|
55
|
+
* />
|
|
56
|
+
*
|
|
57
|
+
* // With custom configuration per plan
|
|
58
|
+
* <PricingTable
|
|
59
|
+
* plans={[
|
|
60
|
+
* { planId: '1', title: 'Basic', subscribeLabel: 'Start Free' },
|
|
61
|
+
* { planId: '2', title: 'Pro', featured: true, subscribeLabel: 'Go Pro' },
|
|
62
|
+
* { planId: '3', title: 'Enterprise', subscribeLabel: 'Contact Us' }
|
|
63
|
+
* ]}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function PricingTable({ plans, currency, showFields, columns, onSubscribe: customOnSubscribe, subscribeLabel, className, onSubscriptionSuccess, onSubscriptionError, referralAddress, loadingComponent, errorComponent }: PricingTableProps): string | number | true | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
//# sourceMappingURL=PricingTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PricingTable.d.ts","sourceRoot":"","sources":["../../../src/components/pricing/PricingTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAY,SAAS,EAAE,MAAM,YAAY,CAAC;AAIjD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,uCAAuC;IACvC,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,6BAA6B;IAC7B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAiB,EACjB,UAAmD,EACnD,OAAO,EACP,WAAW,EAAE,iBAAiB,EAC9B,cAA4B,EAC5B,SAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,EAAE,iBAAiB,0GAwGnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing Components
|
|
3
|
+
*
|
|
4
|
+
* Components for displaying subscription plans and pricing tables.
|
|
5
|
+
*/
|
|
6
|
+
export { PlanCard } from './PlanCard';
|
|
7
|
+
export type { PlanCardProps, PlanField } from './PlanCard';
|
|
8
|
+
export { PricingTable } from './PricingTable';
|
|
9
|
+
export type { PricingTableProps, PlanConfig } from './PricingTable';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pricing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ErrorDisplay Component
|
|
3
|
+
*
|
|
4
|
+
* Context-aware error display with human-readable messages
|
|
5
|
+
* and optional retry/dismiss actions.
|
|
6
|
+
*/
|
|
7
|
+
export interface ErrorDisplayProps {
|
|
8
|
+
/** The error to display */
|
|
9
|
+
error: Error | null;
|
|
10
|
+
/** Callback for retry action (only shown if error is retryable) */
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
/** Callback for dismiss action */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
/** Compact mode for inline display */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
/** Additional CSS class name */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ErrorDisplay Component
|
|
21
|
+
*
|
|
22
|
+
* Automatically maps blockchain errors to user-friendly messages.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <ErrorDisplay
|
|
27
|
+
* error={error}
|
|
28
|
+
* onRetry={() => subscribe(params)}
|
|
29
|
+
* onDismiss={() => setError(null)}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function ErrorDisplay({ error, onRetry, onDismiss, compact, className }: ErrorDisplayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
+
//# sourceMappingURL=ErrorDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/shared/ErrorDisplay.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,SAAS,EACT,OAAe,EACf,SAAc,EACf,EAAE,iBAAiB,kDAoDnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/shared/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,cAAc,4CAY7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal Component
|
|
3
|
+
*/
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
}
|
|
11
|
+
export declare function Modal({ isOpen, onClose, title, children, size }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/shared/Modal.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAW,EAAE,EAAE,UAAU,kDAwDlF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetworkSwitchPrompt Component
|
|
3
|
+
*
|
|
4
|
+
* Displayed when the user is connected to the wrong network.
|
|
5
|
+
* Provides a one-click switch to Arbitrum One.
|
|
6
|
+
*/
|
|
7
|
+
export interface NetworkSwitchPromptProps {
|
|
8
|
+
/** Current chain ID the user is connected to */
|
|
9
|
+
currentChainId: number | null;
|
|
10
|
+
/** Callback to trigger network switch */
|
|
11
|
+
onSwitch: () => void;
|
|
12
|
+
/** Optional callback to dismiss the prompt */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
/** Additional CSS class name */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* NetworkSwitchPrompt Component
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { walletState, switchNetwork } = useWallet();
|
|
23
|
+
*
|
|
24
|
+
* {walletState.chainId && walletState.chainId !== 42161 && (
|
|
25
|
+
* <NetworkSwitchPrompt
|
|
26
|
+
* currentChainId={walletState.chainId}
|
|
27
|
+
* onSwitch={() => switchNetwork(42161)}
|
|
28
|
+
* />
|
|
29
|
+
* )}
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function NetworkSwitchPrompt({ currentChainId, onSwitch, onDismiss, className }: NetworkSwitchPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=NetworkSwitchPrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkSwitchPrompt.d.ts","sourceRoot":"","sources":["../../../src/components/shared/NetworkSwitchPrompt.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAc,EACf,EAAE,wBAAwB,2CA6B1B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SubscryptsErrorBoundaryProps {
|
|
4
|
+
/** Child components to wrap */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Custom fallback UI or render function */
|
|
7
|
+
fallback?: ReactNode | ((error: Error, resetError: () => void) => ReactNode);
|
|
8
|
+
/** Callback when an error is caught */
|
|
9
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
10
|
+
}
|
|
11
|
+
interface ErrorBoundaryState {
|
|
12
|
+
hasError: boolean;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Error Boundary for Subscrypts SDK components.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <SubscryptsErrorBoundary
|
|
21
|
+
* fallback={(error, reset) => (
|
|
22
|
+
* <div>
|
|
23
|
+
* <p>Something went wrong: {error.message}</p>
|
|
24
|
+
* <button onClick={reset}>Try Again</button>
|
|
25
|
+
* </div>
|
|
26
|
+
* )}
|
|
27
|
+
* onError={(error) => analytics.trackError(error)}
|
|
28
|
+
* >
|
|
29
|
+
* <SubscriptionDashboard />
|
|
30
|
+
* </SubscryptsErrorBoundary>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class SubscryptsErrorBoundary extends Component<SubscryptsErrorBoundaryProps, ErrorBoundaryState> {
|
|
34
|
+
constructor(props: SubscryptsErrorBoundaryProps);
|
|
35
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
36
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
37
|
+
resetError: () => void;
|
|
38
|
+
render(): ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=SubscryptsErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscryptsErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/shared/SubscryptsErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,4BAA4B;IAC3C,+BAA+B;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;IAC7E,uCAAuC;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CACxD;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,uBAAwB,SAAQ,SAAS,CACpD,4BAA4B,EAC5B,kBAAkB,CACnB;gBACa,KAAK,EAAE,4BAA4B;IAK/C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIjE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAM3D,UAAU,QAAO,IAAI,CAEnB;IAEF,MAAM,IAAI,SAAS;CAgCpB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfirmDialog Component
|
|
3
|
+
*
|
|
4
|
+
* Reusable confirmation dialog for destructive or important actions.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ConfirmDialog props
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfirmDialogProps {
|
|
10
|
+
/** Whether the dialog is open */
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
/** Dialog title */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Dialog message */
|
|
15
|
+
message: string;
|
|
16
|
+
/** Confirm button label */
|
|
17
|
+
confirmLabel?: string;
|
|
18
|
+
/** Cancel button label */
|
|
19
|
+
cancelLabel?: string;
|
|
20
|
+
/** Visual variant */
|
|
21
|
+
variant?: 'danger' | 'default';
|
|
22
|
+
/** Called when user confirms */
|
|
23
|
+
onConfirm: () => void;
|
|
24
|
+
/** Called when user cancels */
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Confirmation dialog for important actions.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ConfirmDialog
|
|
33
|
+
* isOpen={showConfirm}
|
|
34
|
+
* title="Cancel Subscription?"
|
|
35
|
+
* message="Your subscription will remain active until the end of the current period."
|
|
36
|
+
* variant="danger"
|
|
37
|
+
* confirmLabel="Cancel Subscription"
|
|
38
|
+
* onConfirm={handleCancel}
|
|
39
|
+
* onCancel={() => setShowConfirm(false)}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function ConfirmDialog({ isOpen, title, message, confirmLabel, cancelLabel, variant, onConfirm, onCancel }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/components/subscription/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,gCAAgC;IAChC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,OAAO,EACP,YAAwB,EACxB,WAAsB,EACtB,OAAmB,EACnB,SAAS,EACT,QAAQ,EACT,EAAE,kBAAkB,2CAsBpB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Subscription } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ManageSubscriptionModal props
|
|
5
|
+
*/
|
|
6
|
+
export interface ManageSubscriptionModalProps {
|
|
7
|
+
/** Whether the modal is open */
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/** Close handler */
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** Subscription ID to manage */
|
|
12
|
+
subscriptionId: string;
|
|
13
|
+
/** Pre-loaded subscription data (to skip additional fetch) */
|
|
14
|
+
subscription?: Subscription;
|
|
15
|
+
/** Called when subscription is cancelled */
|
|
16
|
+
onCancelled?: () => void;
|
|
17
|
+
/** Called when subscription is updated */
|
|
18
|
+
onUpdated?: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Modal for managing a subscription with cancel, auto-renew toggle, and cycle updates.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <ManageSubscriptionModal
|
|
26
|
+
* isOpen={showManage}
|
|
27
|
+
* onClose={() => setShowManage(false)}
|
|
28
|
+
* subscriptionId="42"
|
|
29
|
+
* subscription={subscriptionData}
|
|
30
|
+
* onCancelled={() => refetchSubscriptions()}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function ManageSubscriptionModal({ isOpen, onClose, subscriptionId, subscription, onCancelled, onUpdated }: ManageSubscriptionModalProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=ManageSubscriptionModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManageSubscriptionModal.d.ts","sourceRoot":"","sources":["../../../src/components/subscription/ManageSubscriptionModal.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,OAAO,EACP,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACV,EAAE,4BAA4B,2CA8H9B"}
|