@payos-inc/payos-react 1.0.3-staging.6
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/components/identity/IdentityBar.d.ts +8 -0
- package/dist/components/identity/IdentityBar.d.ts.map +1 -0
- package/dist/components/order/OrderSummaryAccordion.d.ts +9 -0
- package/dist/components/order/OrderSummaryAccordion.d.ts.map +1 -0
- package/dist/components/order/ShipmentCard.d.ts +8 -0
- package/dist/components/order/ShipmentCard.d.ts.map +1 -0
- package/dist/components/payos/ActiveCardWidget.d.ts +55 -0
- package/dist/components/payos/ActiveCardWidget.d.ts.map +1 -0
- package/dist/components/payos/PayOSFooter.d.ts +24 -0
- package/dist/components/payos/PayOSFooter.d.ts.map +1 -0
- package/dist/components/payos/PaymentMethodRow.d.ts +53 -0
- package/dist/components/payos/PaymentMethodRow.d.ts.map +1 -0
- package/dist/components/payos/PaymentSheet.d.ts +32 -0
- package/dist/components/payos/PaymentSheet.d.ts.map +1 -0
- package/dist/components/payos/PriceTag.d.ts +64 -0
- package/dist/components/payos/PriceTag.d.ts.map +1 -0
- package/dist/components/payos/ReceiptPanel.d.ts +67 -0
- package/dist/components/payos/ReceiptPanel.d.ts.map +1 -0
- package/dist/components/payos/ViewHeader.d.ts +40 -0
- package/dist/components/payos/ViewHeader.d.ts.map +1 -0
- package/dist/components/payos/drawer.d.ts +98 -0
- package/dist/components/payos/drawer.d.ts.map +1 -0
- package/dist/components/payos/order-summary.d.ts +44 -0
- package/dist/components/payos/order-summary.d.ts.map +1 -0
- package/dist/components/payos/otp-input.d.ts +37 -0
- package/dist/components/payos/otp-input.d.ts.map +1 -0
- package/dist/components/payos/phone-input.d.ts +107 -0
- package/dist/components/payos/phone-input.d.ts.map +1 -0
- package/dist/components/payos/views/AgentRegistrationView.d.ts +58 -0
- package/dist/components/payos/views/AgentRegistrationView.d.ts.map +1 -0
- package/dist/components/payos/views/CardAddView.d.ts +78 -0
- package/dist/components/payos/views/CardAddView.d.ts.map +1 -0
- package/dist/components/payos/views/CheckoutView.d.ts +80 -0
- package/dist/components/payos/views/CheckoutView.d.ts.map +1 -0
- package/dist/components/payos/views/IdentityView.d.ts +43 -0
- package/dist/components/payos/views/IdentityView.d.ts.map +1 -0
- package/dist/components/payos/views/MethodListView.d.ts +52 -0
- package/dist/components/payos/views/MethodListView.d.ts.map +1 -0
- package/dist/components/payos/views/OTPView.d.ts +54 -0
- package/dist/components/payos/views/OTPView.d.ts.map +1 -0
- package/dist/components/payos/views/SuccessView.d.ts +49 -0
- package/dist/components/payos/views/SuccessView.d.ts.map +1 -0
- package/dist/components/payos/views/VisaIframeView.d.ts +19 -0
- package/dist/components/payos/views/VisaIframeView.d.ts.map +1 -0
- package/dist/components/payos/views/VisaMethodView.d.ts +35 -0
- package/dist/components/payos/views/VisaMethodView.d.ts.map +1 -0
- package/dist/components/payos/views/VisaOtpView.d.ts +45 -0
- package/dist/components/payos/views/VisaOtpView.d.ts.map +1 -0
- package/dist/components/payos/views/WelcomeBackView.d.ts +34 -0
- package/dist/components/payos/views/WelcomeBackView.d.ts.map +1 -0
- package/dist/components/ui/CardBrandIcon.d.ts +10 -0
- package/dist/components/ui/CardBrandIcon.d.ts.map +1 -0
- package/dist/components/ui/ConfirmDialog.d.ts +25 -0
- package/dist/components/ui/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ui/InfoTooltip.d.ts +8 -0
- package/dist/components/ui/InfoTooltip.d.ts.map +1 -0
- package/dist/components/ui/PinInput.d.ts +12 -0
- package/dist/components/ui/PinInput.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +15 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useBodyScrollLock.d.ts +32 -0
- package/dist/hooks/useBodyScrollLock.d.ts.map +1 -0
- package/dist/hooks/useCardElement.d.ts +123 -0
- package/dist/hooks/useCardElement.d.ts.map +1 -0
- package/dist/hooks/useCheckoutFlow.d.ts +29 -0
- package/dist/hooks/useCheckoutFlow.d.ts.map +1 -0
- package/dist/hooks/useDrawerState.d.ts +4 -0
- package/dist/hooks/useDrawerState.d.ts.map +1 -0
- package/dist/hooks/usePasskeySDK.d.ts +99 -0
- package/dist/hooks/usePasskeySDK.d.ts.map +1 -0
- package/dist/hooks/useSession.d.ts +68 -0
- package/dist/hooks/useSession.d.ts.map +1 -0
- package/dist/hooks/useVisualViewport.d.ts +15 -0
- package/dist/hooks/useVisualViewport.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/theme.d.ts +53 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/mocks/index.d.ts +3 -0
- package/dist/mocks/index.d.ts.map +1 -0
- package/dist/mocks/mockCheckoutFlow.d.ts +25 -0
- package/dist/mocks/mockCheckoutFlow.d.ts.map +1 -0
- package/dist/mocks/mockData.d.ts +6 -0
- package/dist/mocks/mockData.d.ts.map +1 -0
- package/dist/mocks/mockSessionData.d.ts +38 -0
- package/dist/mocks/mockSessionData.d.ts.map +1 -0
- package/dist/payos-react.css +1 -0
- package/dist/payos-react.esm.js +23 -0
- package/dist/payos-react.min.js +1 -0
- package/dist/services/apiService.d.ts +297 -0
- package/dist/services/apiService.d.ts.map +1 -0
- package/dist/services/linkTokenService.d.ts +27 -0
- package/dist/services/linkTokenService.d.ts.map +1 -0
- package/dist/services/mockSessionService.d.ts +78 -0
- package/dist/services/mockSessionService.d.ts.map +1 -0
- package/dist/types/cardElement.d.ts +138 -0
- package/dist/types/cardElement.d.ts.map +1 -0
- package/dist/types/components/identity/IdentityBar.d.ts +8 -0
- package/dist/types/components/identity/IdentityBar.d.ts.map +1 -0
- package/dist/types/components/order/OrderSummaryAccordion.d.ts +9 -0
- package/dist/types/components/order/OrderSummaryAccordion.d.ts.map +1 -0
- package/dist/types/components/order/ShipmentCard.d.ts +8 -0
- package/dist/types/components/order/ShipmentCard.d.ts.map +1 -0
- package/dist/types/components/payos/ActiveCardWidget.d.ts +55 -0
- package/dist/types/components/payos/ActiveCardWidget.d.ts.map +1 -0
- package/dist/types/components/payos/PayOSFooter.d.ts +24 -0
- package/dist/types/components/payos/PayOSFooter.d.ts.map +1 -0
- package/dist/types/components/payos/PaymentMethodRow.d.ts +53 -0
- package/dist/types/components/payos/PaymentMethodRow.d.ts.map +1 -0
- package/dist/types/components/payos/PaymentSheet.d.ts +32 -0
- package/dist/types/components/payos/PaymentSheet.d.ts.map +1 -0
- package/dist/types/components/payos/PriceTag.d.ts +64 -0
- package/dist/types/components/payos/PriceTag.d.ts.map +1 -0
- package/dist/types/components/payos/ReceiptPanel.d.ts +67 -0
- package/dist/types/components/payos/ReceiptPanel.d.ts.map +1 -0
- package/dist/types/components/payos/ViewHeader.d.ts +40 -0
- package/dist/types/components/payos/ViewHeader.d.ts.map +1 -0
- package/dist/types/components/payos/drawer.d.ts +98 -0
- package/dist/types/components/payos/drawer.d.ts.map +1 -0
- package/dist/types/components/payos/order-summary.d.ts +44 -0
- package/dist/types/components/payos/order-summary.d.ts.map +1 -0
- package/dist/types/components/payos/otp-input.d.ts +37 -0
- package/dist/types/components/payos/otp-input.d.ts.map +1 -0
- package/dist/types/components/payos/phone-input.d.ts +107 -0
- package/dist/types/components/payos/phone-input.d.ts.map +1 -0
- package/dist/types/components/payos/views/AgentRegistrationView.d.ts +58 -0
- package/dist/types/components/payos/views/AgentRegistrationView.d.ts.map +1 -0
- package/dist/types/components/payos/views/CardAddView.d.ts +78 -0
- package/dist/types/components/payos/views/CardAddView.d.ts.map +1 -0
- package/dist/types/components/payos/views/CheckoutView.d.ts +80 -0
- package/dist/types/components/payos/views/CheckoutView.d.ts.map +1 -0
- package/dist/types/components/payos/views/IdentityView.d.ts +43 -0
- package/dist/types/components/payos/views/IdentityView.d.ts.map +1 -0
- package/dist/types/components/payos/views/MethodListView.d.ts +52 -0
- package/dist/types/components/payos/views/MethodListView.d.ts.map +1 -0
- package/dist/types/components/payos/views/OTPView.d.ts +54 -0
- package/dist/types/components/payos/views/OTPView.d.ts.map +1 -0
- package/dist/types/components/payos/views/SuccessView.d.ts +49 -0
- package/dist/types/components/payos/views/SuccessView.d.ts.map +1 -0
- package/dist/types/components/payos/views/VisaIframeView.d.ts +19 -0
- package/dist/types/components/payos/views/VisaIframeView.d.ts.map +1 -0
- package/dist/types/components/payos/views/VisaMethodView.d.ts +35 -0
- package/dist/types/components/payos/views/VisaMethodView.d.ts.map +1 -0
- package/dist/types/components/payos/views/VisaOtpView.d.ts +45 -0
- package/dist/types/components/payos/views/VisaOtpView.d.ts.map +1 -0
- package/dist/types/components/payos/views/WelcomeBackView.d.ts +34 -0
- package/dist/types/components/payos/views/WelcomeBackView.d.ts.map +1 -0
- package/dist/types/components/ui/CardBrandIcon.d.ts +10 -0
- package/dist/types/components/ui/CardBrandIcon.d.ts.map +1 -0
- package/dist/types/components/ui/ConfirmDialog.d.ts +25 -0
- package/dist/types/components/ui/ConfirmDialog.d.ts.map +1 -0
- package/dist/types/components/ui/InfoTooltip.d.ts +8 -0
- package/dist/types/components/ui/InfoTooltip.d.ts.map +1 -0
- package/dist/types/components/ui/PinInput.d.ts +12 -0
- package/dist/types/components/ui/PinInput.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +14 -0
- package/dist/types/components/ui/button.d.ts.map +1 -0
- package/dist/types/components/ui/card.d.ts +15 -0
- package/dist/types/components/ui/card.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +6 -0
- package/dist/types/components/ui/input.d.ts.map +1 -0
- package/dist/types/components/ui/label.d.ts +6 -0
- package/dist/types/components/ui/label.d.ts.map +1 -0
- package/dist/types/components/ui/separator.d.ts +5 -0
- package/dist/types/components/ui/separator.d.ts.map +1 -0
- package/dist/types/drawer.d.ts +33 -0
- package/dist/types/drawer.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useBodyScrollLock.d.ts +32 -0
- package/dist/types/hooks/useBodyScrollLock.d.ts.map +1 -0
- package/dist/types/hooks/useCardElement.d.ts +123 -0
- package/dist/types/hooks/useCardElement.d.ts.map +1 -0
- package/dist/types/hooks/useCheckoutFlow.d.ts +29 -0
- package/dist/types/hooks/useCheckoutFlow.d.ts.map +1 -0
- package/dist/types/hooks/useDrawerState.d.ts +4 -0
- package/dist/types/hooks/useDrawerState.d.ts.map +1 -0
- package/dist/types/hooks/usePasskeySDK.d.ts +99 -0
- package/dist/types/hooks/usePasskeySDK.d.ts.map +1 -0
- package/dist/types/hooks/useSession.d.ts +68 -0
- package/dist/types/hooks/useSession.d.ts.map +1 -0
- package/dist/types/hooks/useVisualViewport.d.ts +15 -0
- package/dist/types/hooks/useVisualViewport.d.ts.map +1 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/theme.d.ts +53 -0
- package/dist/types/lib/theme.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +3 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/mocks/index.d.ts +3 -0
- package/dist/types/mocks/index.d.ts.map +1 -0
- package/dist/types/mocks/mockCheckoutFlow.d.ts +25 -0
- package/dist/types/mocks/mockCheckoutFlow.d.ts.map +1 -0
- package/dist/types/mocks/mockData.d.ts +6 -0
- package/dist/types/mocks/mockData.d.ts.map +1 -0
- package/dist/types/mocks/mockSessionData.d.ts +38 -0
- package/dist/types/mocks/mockSessionData.d.ts.map +1 -0
- package/dist/types/order.d.ts +25 -0
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/payment.d.ts +52 -0
- package/dist/types/payment.d.ts.map +1 -0
- package/dist/types/services/apiService.d.ts +297 -0
- package/dist/types/services/apiService.d.ts.map +1 -0
- package/dist/types/services/linkTokenService.d.ts +27 -0
- package/dist/types/services/linkTokenService.d.ts.map +1 -0
- package/dist/types/services/mockSessionService.d.ts +78 -0
- package/dist/types/services/mockSessionService.d.ts.map +1 -0
- package/dist/types/session.d.ts +148 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/types/cardElement.d.ts +138 -0
- package/dist/types/types/cardElement.d.ts.map +1 -0
- package/dist/types/types/drawer.d.ts +33 -0
- package/dist/types/types/drawer.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/order.d.ts +25 -0
- package/dist/types/types/order.d.ts.map +1 -0
- package/dist/types/types/payment.d.ts +52 -0
- package/dist/types/types/payment.d.ts.map +1 -0
- package/dist/types/types/session.d.ts +148 -0
- package/dist/types/types/session.d.ts.map +1 -0
- package/dist/types/utils/deviceFingerprint.d.ts +27 -0
- package/dist/types/utils/deviceFingerprint.d.ts.map +1 -0
- package/dist/types/utils/environment.d.ts +22 -0
- package/dist/types/utils/environment.d.ts.map +1 -0
- package/dist/types/utils/formatting.d.ts +38 -0
- package/dist/types/utils/formatting.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +52 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/dist/utils/deviceFingerprint.d.ts +27 -0
- package/dist/utils/deviceFingerprint.d.ts.map +1 -0
- package/dist/utils/environment.d.ts +22 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +38 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +52 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WelcomeBackView - Profile Selection / Known User Identity Confirmation
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - "Welcome back!" headline for warm greeting
|
|
7
|
+
* - Identity Tile: Compact card showing phone number with verified indicator
|
|
8
|
+
* - User icon in rounded gray container (non-floaty design)
|
|
9
|
+
* - Clean vertical flow: Headline → Tile → Button → Subtext
|
|
10
|
+
* - "Not you?" link for account switching
|
|
11
|
+
*
|
|
12
|
+
* Design Pattern: "Sandwich" layout with subtext below button for better hierarchy
|
|
13
|
+
*/
|
|
14
|
+
interface WelcomeBackViewProps {
|
|
15
|
+
/**
|
|
16
|
+
* Prefilled phone number (formatted)
|
|
17
|
+
*/
|
|
18
|
+
phone: string;
|
|
19
|
+
/**
|
|
20
|
+
* Continue handler (sends SMS code)
|
|
21
|
+
*/
|
|
22
|
+
onContinue: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Switch account handler (clears prefill, goes to IdentityView)
|
|
25
|
+
*/
|
|
26
|
+
onSwitchAccount: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether continue action is loading
|
|
29
|
+
*/
|
|
30
|
+
isLoading?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const WelcomeBackView: React.FC<WelcomeBackViewProps>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=WelcomeBackView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeBackView.d.ts","sourceRoot":"","sources":["../../../../src/components/payos/views/WelcomeBackView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;;;;;GAWG;AAEH,UAAU,oBAAoB;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsE1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardBrand } from '../../types/payment';
|
|
3
|
+
interface CardBrandIconProps {
|
|
4
|
+
brand: CardBrand;
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CardBrandIcon: React.FC<CardBrandIconProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=CardBrandIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardBrandIcon.d.ts","sourceRoot":"","sources":["../../../src/components/ui/CardBrandIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyCtD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* ConfirmDialog - Reusable confirmation modal
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Semi-transparent backdrop overlay
|
|
7
|
+
* - Centered modal card
|
|
8
|
+
* - Title, message, Cancel and Confirm buttons
|
|
9
|
+
* - variant='danger' for red confirm button (delete actions)
|
|
10
|
+
* - Loading state support
|
|
11
|
+
*/
|
|
12
|
+
interface ConfirmDialogProps {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
title: string;
|
|
15
|
+
message: string;
|
|
16
|
+
confirmText?: string;
|
|
17
|
+
cancelText?: string;
|
|
18
|
+
onConfirm: () => void;
|
|
19
|
+
onCancel: () => void;
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
variant?: "danger" | "default";
|
|
22
|
+
}
|
|
23
|
+
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;GASG;AAEH,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyEtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/InfoTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2BlD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PinInputProps {
|
|
3
|
+
length: number;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
onComplete?: () => void;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const PinInput: React.FC<PinInputProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=PinInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinInput.d.ts","sourceRoot":"","sources":["../../../src/components/ui/PinInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmF5C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
loadingText?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export { Button, buttonVariants };
|
|
14
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,cAAc;;;mFA4BnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,uFAuBX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const cardVariants: (props?: ({
|
|
4
|
+
variant?: "flat" | "default" | "transparent" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
12
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
15
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,YAAY;;mFAcjB,CAAC;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAExC,QAAA,MAAM,IAAI,kFAQT,CAAC;AAGF,QAAA,MAAM,UAAU,6GASd,CAAC;AAGH,QAAA,MAAM,SAAS,uHAYb,CAAC;AAGH,QAAA,MAAM,eAAe,yHASnB,CAAC;AAGH,QAAA,MAAM,WAAW,6GAKf,CAAC;AAGH,QAAA,MAAM,UAAU,6GASd,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
}
|
|
4
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export { Input };
|
|
6
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAExD,QAAA,MAAM,KAAK,qFAeV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/ui/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,QAAA,MAAM,KAAK,iQAUT,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAIhE,QAAA,MAAM,SAAS,6JAoBd,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './useCheckoutFlow';
|
|
2
|
+
export * from './useDrawerState';
|
|
3
|
+
export * from './useVisualViewport';
|
|
4
|
+
export * from './useBodyScrollLock';
|
|
5
|
+
export * from './useCardElement';
|
|
6
|
+
export * from './useSession';
|
|
7
|
+
export * from './usePasskeySDK';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useBodyScrollLock - Prevent body scroll and rubber banding on mobile
|
|
3
|
+
*
|
|
4
|
+
* This hook prevents scroll bleed to the background when a modal/drawer is open.
|
|
5
|
+
* It uses multiple techniques to handle iOS Safari quirks:
|
|
6
|
+
*
|
|
7
|
+
* 1. Sets `overflow: hidden` to prevent scroll
|
|
8
|
+
* 2. Sets `position: fixed` to prevent iOS elastic scrolling (rubber banding)
|
|
9
|
+
* 3. Preserves scroll position by setting `top: -scrollY`
|
|
10
|
+
* 4. Optionally sets `touch-action: none` for additional touch prevention
|
|
11
|
+
*
|
|
12
|
+
* **iOS Safari Issues Addressed:**
|
|
13
|
+
* - Scroll bleed: Background scrolling while drawer is open
|
|
14
|
+
* - Rubber banding: Elastic/bouncy overscroll effect
|
|
15
|
+
* - Layout shift: Maintains width to prevent content jump
|
|
16
|
+
*
|
|
17
|
+
* @param isLocked - Whether scroll should be locked
|
|
18
|
+
* @param options - Configuration options
|
|
19
|
+
* @param options.preventTouch - Whether to prevent all touch actions (default: false)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* function Drawer({ open }) {
|
|
24
|
+
* useBodyScrollLock(open);
|
|
25
|
+
* // Body scroll is now locked when drawer is open
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function useBodyScrollLock(isLocked: boolean, options?: {
|
|
30
|
+
preventTouch?: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
//# sourceMappingURL=useBodyScrollLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBodyScrollLock.d.ts","sourceRoot":"","sources":["../../src/hooks/useBodyScrollLock.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EACjB,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GACvC,IAAI,CAuCN"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { CardElementOptions, CardElementStyles, CardElementConfiguration, CardElementTokenizedEvent, CardElementChangeEvent } from '../types/cardElement';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the useCardElement hook
|
|
4
|
+
*/
|
|
5
|
+
export interface UseCardElementOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Link token for CardElement initialization (required)
|
|
8
|
+
*/
|
|
9
|
+
token: string;
|
|
10
|
+
/**
|
|
11
|
+
* Target environment
|
|
12
|
+
*/
|
|
13
|
+
environment?: 'sandbox' | 'production';
|
|
14
|
+
/**
|
|
15
|
+
* Optional custom styles for secure fields
|
|
16
|
+
*/
|
|
17
|
+
styles?: CardElementStyles;
|
|
18
|
+
/**
|
|
19
|
+
* Optional height override for the iframe
|
|
20
|
+
*/
|
|
21
|
+
height?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Custom base URL override for non-standard environments
|
|
24
|
+
*/
|
|
25
|
+
customBaseUrl?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Custom query params for testing
|
|
28
|
+
*/
|
|
29
|
+
customParams?: Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Callback fired when card is tokenized successfully
|
|
32
|
+
*/
|
|
33
|
+
onTokenized?: (event: CardElementTokenizedEvent) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired when iframe is ready
|
|
36
|
+
*/
|
|
37
|
+
onReady?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback fired on error
|
|
40
|
+
*/
|
|
41
|
+
onError?: (error: Error) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when form fields change
|
|
44
|
+
*/
|
|
45
|
+
onChange?: (event: CardElementChangeEvent) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback fired when user cancels the flow
|
|
48
|
+
*/
|
|
49
|
+
onCancel?: () => void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Return type for the useCardElement hook
|
|
53
|
+
*/
|
|
54
|
+
export interface UseCardElementReturn {
|
|
55
|
+
/**
|
|
56
|
+
* Ref to attach to the container element
|
|
57
|
+
*/
|
|
58
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the CardElement iframe is ready
|
|
61
|
+
*/
|
|
62
|
+
isReady: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the form is complete (all required fields valid)
|
|
65
|
+
*/
|
|
66
|
+
isComplete: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the form is empty (no fields have values)
|
|
69
|
+
*/
|
|
70
|
+
isEmpty: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Current error message if any
|
|
73
|
+
*/
|
|
74
|
+
error: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Trigger form submission (tokenization)
|
|
77
|
+
*/
|
|
78
|
+
submit: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Configure the CardElement with additional data
|
|
81
|
+
* (walletUserId, cardholderName, billingAddress)
|
|
82
|
+
*/
|
|
83
|
+
configure: (config: CardElementConfiguration) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Update styles dynamically
|
|
86
|
+
*/
|
|
87
|
+
updateStyles: (styles: CardElementStyles) => void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* React hook to manage the CardElementClient lifecycle
|
|
91
|
+
*
|
|
92
|
+
* Handles mounting/unmounting the iframe, message communication,
|
|
93
|
+
* and provides React-friendly state and callbacks.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* const { containerRef, isReady, isComplete, submit } = useCardElement({
|
|
98
|
+
* token: session.linkToken,
|
|
99
|
+
* onTokenized: (event) => {
|
|
100
|
+
* console.log('Card tokenized:', event.card);
|
|
101
|
+
* addPaymentCard({
|
|
102
|
+
* cardId: event.card?.id || '',
|
|
103
|
+
* last4: event.card?.last4 || '',
|
|
104
|
+
* brand: event.card?.brand || 'unknown',
|
|
105
|
+
* network: event.card?.brand || 'unknown',
|
|
106
|
+
* cardArtUrl: event.card?.artwork,
|
|
107
|
+
* });
|
|
108
|
+
* },
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* return (
|
|
112
|
+
* <div>
|
|
113
|
+
* <div ref={containerRef} style={{ minHeight: 400 }} />
|
|
114
|
+
* <button onClick={submit} disabled={!isComplete}>
|
|
115
|
+
* Add Card
|
|
116
|
+
* </button>
|
|
117
|
+
* </div>
|
|
118
|
+
* );
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare function useCardElement(options: UseCardElementOptions): UseCardElementReturn;
|
|
122
|
+
export type { CardElementOptions, CardElementStyles, CardElementConfiguration, CardElementTokenizedEvent, CardElementChangeEvent, };
|
|
123
|
+
//# sourceMappingURL=useCardElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCardElement.d.ts","sourceRoot":"","sources":["../../src/hooks/useCardElement.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAE9C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;;OAGG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB,CAiInF;AAGD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CheckoutState, CardData, BillingAddress, SavedCard, PaymentView } from '../types';
|
|
2
|
+
interface UseCheckoutFlowProps {
|
|
3
|
+
mode: 'standard' | 'agent';
|
|
4
|
+
amount: number;
|
|
5
|
+
savedCards?: SavedCard[];
|
|
6
|
+
onSuccess?: (result: any) => void;
|
|
7
|
+
onError?: (error: any) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useCheckoutFlow({ mode, amount, savedCards, onSuccess, onError }: UseCheckoutFlowProps): {
|
|
10
|
+
state: CheckoutState;
|
|
11
|
+
selectedCardId: string | null;
|
|
12
|
+
paymentView: PaymentView;
|
|
13
|
+
cvc: string;
|
|
14
|
+
setCvc: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
15
|
+
submitPhone: (phone: string) => Promise<void>;
|
|
16
|
+
verifyOTP: (otp: string) => Promise<void>;
|
|
17
|
+
submitPayment: (email: string, cardData: CardData, billingAddress: BillingAddress | null) => Promise<void>;
|
|
18
|
+
selectCard: (cardId: string) => void;
|
|
19
|
+
addCard: (cardData: CardData) => Promise<void>;
|
|
20
|
+
logout: () => void;
|
|
21
|
+
setError: (error: string | null) => void;
|
|
22
|
+
showMethodList: () => void;
|
|
23
|
+
showAddCard: () => void;
|
|
24
|
+
returnToCheckout: () => void;
|
|
25
|
+
skipToPayment: () => void;
|
|
26
|
+
completeAgentRegistration: () => void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=useCheckoutFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCheckoutFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckoutFlow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGhG,UAAU,oBAAoB;IAC5B,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,oBAAoB;;;;;;yBAkCtD,MAAM;qBAmBV,MAAM;2BAmCvC,MAAM,YACH,QAAQ,kBACF,cAAc,GAAG,IAAI;yBAuCC,MAAM;wBAOD,QAAQ;;sBA/GhB,MAAM,GAAG,IAAI;;;;;;EAuOnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrawerState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrawerState.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI;;EA6ChE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePasskeySDK Hook
|
|
3
|
+
*
|
|
4
|
+
* Manages the PayOS Passkey SDK lifecycle and exposes passkey operations
|
|
5
|
+
* for registration and authentication flows.
|
|
6
|
+
*/
|
|
7
|
+
import { PayOSPasskey, RegisterResult, PasskeyResult, OTPSubmitResult } from '@payos-inc/payos-passkey-js';
|
|
8
|
+
/**
|
|
9
|
+
* Step-up verification method (for Visa OTP flow)
|
|
10
|
+
*/
|
|
11
|
+
export interface StepUpMethod {
|
|
12
|
+
id: string;
|
|
13
|
+
type: 'sms' | 'email';
|
|
14
|
+
maskedValue: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuration options for the passkey SDK hook
|
|
18
|
+
*/
|
|
19
|
+
export interface UsePasskeySDKOptions {
|
|
20
|
+
/** Session secret (JWT) - used as linkToken for the SDK */
|
|
21
|
+
sessionSecret: string;
|
|
22
|
+
/** Use sandbox environment */
|
|
23
|
+
sandbox?: boolean;
|
|
24
|
+
/** Enable debug logging */
|
|
25
|
+
debug?: boolean;
|
|
26
|
+
/** Container ID for Visa iframe placement */
|
|
27
|
+
visaContainerId?: string;
|
|
28
|
+
/** Backend API base URL (e.g., http://localhost:3001 or ngrok tunnel) */
|
|
29
|
+
apiBaseUrl?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Internal state for passkey operations
|
|
33
|
+
*/
|
|
34
|
+
export interface PasskeyState {
|
|
35
|
+
/** Current enrollment ID (for Visa step-up flow) */
|
|
36
|
+
enrollmentId: string | null;
|
|
37
|
+
/** Available step-up methods (Visa) */
|
|
38
|
+
stepUpMethods: StepUpMethod[];
|
|
39
|
+
/** Selected method description (e.g., "***-***-1234") */
|
|
40
|
+
selectedMethodDescription: string | null;
|
|
41
|
+
/** Loading state */
|
|
42
|
+
isLoading: boolean;
|
|
43
|
+
/** Error message */
|
|
44
|
+
error: string | null;
|
|
45
|
+
/** Whether user can retry OTP (false = locked out) */
|
|
46
|
+
canRetry: boolean;
|
|
47
|
+
/** Number of OTP attempts remaining */
|
|
48
|
+
attemptsRemaining?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Return type for usePasskeySDK hook
|
|
52
|
+
*/
|
|
53
|
+
export interface UsePasskeySDKReturn {
|
|
54
|
+
/** SDK instance (for advanced use) */
|
|
55
|
+
sdk: PayOSPasskey | null;
|
|
56
|
+
/** Whether SDK is ready for operations */
|
|
57
|
+
isReady: boolean;
|
|
58
|
+
/** Current state */
|
|
59
|
+
state: PasskeyState;
|
|
60
|
+
/** Start registration flow for a card */
|
|
61
|
+
startRegistration: (cardId: string) => Promise<RegisterResult>;
|
|
62
|
+
/** Select step-up method (Visa) - sends OTP */
|
|
63
|
+
selectStepUpMethod: (methodIndex: number) => Promise<OTPSubmitResult>;
|
|
64
|
+
/** Submit OTP for Visa step-up verification (returns registrationContext on success) */
|
|
65
|
+
submitVisaOtp: (otp: string) => Promise<PasskeyResult>;
|
|
66
|
+
/** Complete Visa registration after iframe container is rendered */
|
|
67
|
+
completeVisaRegistration: (registrationContext: any) => Promise<PasskeyResult>;
|
|
68
|
+
/** Authenticate a payment */
|
|
69
|
+
authenticate: (paymentIntentId: string, paymentId?: string) => Promise<PasskeyResult>;
|
|
70
|
+
/** Clear current error */
|
|
71
|
+
clearError: () => void;
|
|
72
|
+
/** Reset state (for restarting flows) */
|
|
73
|
+
resetState: () => void;
|
|
74
|
+
/** Cleanup SDK resources */
|
|
75
|
+
cleanup: () => void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Hook for managing PayOS Passkey SDK operations
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* const passkey = usePasskeySDK({
|
|
83
|
+
* sessionSecret: session.secret,
|
|
84
|
+
* sandbox: true,
|
|
85
|
+
* debug: true,
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* // Registration
|
|
89
|
+
* const result = await passkey.startRegistration(cardId);
|
|
90
|
+
* if (result.requiresStepUp) {
|
|
91
|
+
* // Show Visa OTP flow
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* // Authentication
|
|
95
|
+
* const authResult = await passkey.authenticate(paymentIntentId);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function usePasskeySDK(options: UsePasskeySDKOptions): UsePasskeySDKReturn;
|
|
99
|
+
//# sourceMappingURL=usePasskeySDK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePasskeySDK.d.ts","sourceRoot":"","sources":["../../src/hooks/usePasskeySDK.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IA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,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,yCAAyC;IACzC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAYD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA4RhF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CheckoutSession, VerificationResult, CompletionResult, SavedCard, PaymentSheetError } from '../types/session';
|
|
2
|
+
import { PaymentView } from '../types/payment';
|
|
3
|
+
export type SessionPhase = 'LOADING' | 'ERROR' | 'IDENTITY' | 'OTP_VERIFY' | 'PAYMENT' | 'AGENT_REGISTRATION' | 'PROCESSING' | 'SUCCESS' | 'EXPIRED';
|
|
4
|
+
/**
|
|
5
|
+
* Sub-phases for passkey registration flow (within AGENT_REGISTRATION)
|
|
6
|
+
* - 'initial': Show AgentRegistrationView with "Create Passkey" button
|
|
7
|
+
* - 'visa_method_select': Show VisaMethodView to select OTP method
|
|
8
|
+
* - 'visa_otp_entry': Show VisaOtpView to enter OTP code
|
|
9
|
+
* - 'visa_iframe': Show VisaIframeView with SDK iframe after OTP validates
|
|
10
|
+
*/
|
|
11
|
+
export type RegistrationSubPhase = 'initial' | 'visa_method_select' | 'visa_otp_entry' | 'visa_iframe';
|
|
12
|
+
export type { PaymentView } from '../types/payment';
|
|
13
|
+
export interface UseSessionReturn {
|
|
14
|
+
session: CheckoutSession | null;
|
|
15
|
+
phase: SessionPhase;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
error: PaymentSheetError | null;
|
|
18
|
+
isAgentMode: boolean;
|
|
19
|
+
hasSelectedCard: boolean;
|
|
20
|
+
hasSavedCards: boolean;
|
|
21
|
+
paymentView: PaymentView;
|
|
22
|
+
cvc: string;
|
|
23
|
+
setCvc: (cvc: string) => void;
|
|
24
|
+
showMethodList: () => void;
|
|
25
|
+
showAddCard: () => void;
|
|
26
|
+
returnToCheckout: () => void;
|
|
27
|
+
submitIdentity: (contact: {
|
|
28
|
+
email?: string;
|
|
29
|
+
phone?: string;
|
|
30
|
+
}) => Promise<boolean>;
|
|
31
|
+
goBackToIdentity: () => void;
|
|
32
|
+
submitOTP: (code: string) => Promise<VerificationResult>;
|
|
33
|
+
resendCode: () => Promise<boolean>;
|
|
34
|
+
selectPaymentCard: (cardId: string) => Promise<boolean>;
|
|
35
|
+
addPaymentCard: (tokenizedCard: {
|
|
36
|
+
cardId: string;
|
|
37
|
+
last4: string;
|
|
38
|
+
brand: string;
|
|
39
|
+
network: string;
|
|
40
|
+
expiryMonth?: string;
|
|
41
|
+
expiryYear?: string;
|
|
42
|
+
cardholderName?: string;
|
|
43
|
+
cardArtUrl?: string;
|
|
44
|
+
}) => Promise<{
|
|
45
|
+
success: boolean;
|
|
46
|
+
card?: SavedCard;
|
|
47
|
+
}>;
|
|
48
|
+
deletePaymentCard: (cardId: string) => Promise<boolean>;
|
|
49
|
+
clearCard: () => Promise<void>;
|
|
50
|
+
registrationSubPhase: RegistrationSubPhase;
|
|
51
|
+
setRegistrationSubPhase: (subPhase: RegistrationSubPhase) => void;
|
|
52
|
+
skipRegistration: () => void;
|
|
53
|
+
completeAgentRegistration: () => void;
|
|
54
|
+
setPhase: (phase: SessionPhase) => void;
|
|
55
|
+
setPaymentView: (view: PaymentView) => void;
|
|
56
|
+
complete: (options?: {
|
|
57
|
+
passkeyAuthenticated?: boolean;
|
|
58
|
+
}) => Promise<CompletionResult>;
|
|
59
|
+
abandon: () => Promise<void>;
|
|
60
|
+
clearError: () => void;
|
|
61
|
+
refresh: () => Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export interface UseSessionOptions {
|
|
64
|
+
/** API base URL for credential generation and other API calls */
|
|
65
|
+
apiBaseUrl: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function useSession(sessionSecret: string, options: UseSessionOptions): UseSessionReturn;
|
|
68
|
+
//# sourceMappingURL=useSession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AAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAG7B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CA2zB9F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function useVisualViewport(): number;
|
|
3
|
+
/**
|
|
4
|
+
* useVisualViewportStyle - Returns inline style object with bottom offset
|
|
5
|
+
*
|
|
6
|
+
* Convenience hook that returns a style object to spread directly onto elements.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const style = useVisualViewportStyle();
|
|
11
|
+
* return <div className="fixed bottom-0" style={style}>Content</div>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function useVisualViewportStyle(): React.CSSProperties;
|
|
15
|
+
//# sourceMappingURL=useVisualViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVisualViewport.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisualViewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+B/B,wBAAgB,iBAAiB,IAAI,MAAM,CAoD1C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,KAAK,CAAC,aAAa,CAS5D"}
|