@12-apps/payments-frontend 3.36.0 → 3.38.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/package.json +1 -1
- package/src/components/checkout/card-sources.ts +131 -0
- package/src/components/checkout/card-view.tsx +6 -2
- package/src/components/checkout/cart-changed.tsx +50 -18
- package/src/components/checkout/checkout-actions.ts +18 -0
- package/src/components/checkout/checkout-flow.tsx +24 -77
- package/src/components/checkout/google-pay-button.tsx +4 -4
- package/src/components/checkout/list/buyer-inline.tsx +125 -0
- package/src/components/checkout/list/charge-runners.tsx +156 -0
- package/src/components/checkout/list/choice-list.tsx +156 -0
- package/src/components/checkout/list/choice.ts +193 -0
- package/src/components/checkout/list/context.tsx +55 -0
- package/src/components/checkout/list/en-US.ts +61 -0
- package/src/components/checkout/list/list-bar.tsx +186 -0
- package/src/components/checkout/list/list-face.tsx +315 -0
- package/src/components/checkout/list/list-pix.tsx +206 -0
- package/src/components/checkout/list/online-content.tsx +137 -0
- package/src/components/checkout/list/option-row.tsx +123 -0
- package/src/components/checkout/list/payment-list-step.tsx +166 -0
- package/src/components/checkout/list/pt-BR.ts +77 -0
- package/src/components/checkout/list/types.ts +187 -0
- package/src/components/checkout/list/use-capability.ts +53 -0
- package/src/components/checkout/list/use-list-charge.ts +161 -0
- package/src/components/checkout/list/use-list-state.ts +152 -0
- package/src/components/checkout/payment-phase.tsx +119 -0
- package/src/components/checkout/pix-after-copy.tsx +10 -3
- package/src/components/checkout/pix-pane.tsx +33 -22
- package/src/components/checkout/pix-parts.tsx +50 -1
- package/src/components/checkout/pix-view.tsx +53 -20
- package/src/components/checkout/screens-copy.ts +6 -0
- package/src/components/checkout/screens-en-US.ts +1 -0
- package/src/components/checkout/screens-pt-BR.ts +1 -0
- package/src/components/checkout/use-card-checkout.ts +11 -78
- package/src/components/checkout/use-checkout-controller.ts +3 -1
- package/src/flows/create-payment-flows.tsx +7 -0
- package/src/flows/types.ts +7 -0
- package/src/index.ts +4 -5
- package/src/locales.ts +13 -0
package/src/flows/types.ts
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* `chain[].provider`, looked up in the tokenizer registry and used verbatim as
|
|
20
20
|
* a `tokensByProvider` key. A host never types one.
|
|
21
21
|
*/
|
|
22
|
+
import type { CheckoutPaymentList } from "../components/checkout/list/types";
|
|
22
23
|
import type { ComponentType, ReactNode } from "react";
|
|
23
24
|
|
|
24
25
|
import type { SavedCard } from "../card";
|
|
@@ -115,6 +116,12 @@ export interface PaymentFlowsConfig extends CheckoutPipelineConfig {
|
|
|
115
116
|
useBuyerDefaults?(): { buyer?: BuyerInfo; taxIdOnFile?: boolean; pending?: boolean };
|
|
116
117
|
/** Present ⇒ this checkout settles a settlement rather than the cart. */
|
|
117
118
|
useSettlement?(): SettlementCheckout | null;
|
|
119
|
+
/**
|
|
120
|
+
* The Pagamento step as ONE list (FUT-3591) — `CheckoutFlowProps.paymentList`,
|
|
121
|
+
* read through a HOOK because the host's door options follow its own state.
|
|
122
|
+
* Absent, or answering `undefined`, keeps the method tabs.
|
|
123
|
+
*/
|
|
124
|
+
usePaymentList?(): CheckoutPaymentList | undefined;
|
|
118
125
|
|
|
119
126
|
/** Design-system slots, filled ONCE instead of per screen. */
|
|
120
127
|
components?: Partial<CheckoutComponents>;
|
package/src/index.ts
CHANGED
|
@@ -54,11 +54,10 @@ export { PT_BR_CHECKOUT_PAYMENT_COPY } from './components/checkout-payment-pt-BR
|
|
|
54
54
|
// mounted by a host in one line. See ADOPTING.md §3 for the ports and the
|
|
55
55
|
// design-system slot contract.
|
|
56
56
|
// ---------------------------------------------------------------------------
|
|
57
|
-
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} from './components/checkout/checkout-flow';
|
|
57
|
+
export { CheckoutFlow, type CheckoutCartView, type CheckoutFlowProps } from './components/checkout/checkout-flow';
|
|
58
|
+
// The Pagamento step as ONE list (FUT-3591/3592) — opt-in via `CheckoutFlowProps.paymentList`.
|
|
59
|
+
export type { CheckoutDoorOption, CheckoutListChoice, CheckoutListHold, CheckoutOnlineChoice, CheckoutPaymentList, PaymentListCopy } from './components/checkout/list/types';
|
|
60
|
+
export { PT_BR_PAYMENT_LIST_COPY } from './components/checkout/list/pt-BR';
|
|
62
61
|
export type { BackActionEmphasis } from './components/checkout/payment-status-parts';
|
|
63
62
|
export type { CheckoutDeliverySummary, CheckoutSummaryLine } from './components/checkout/payment-summary';
|
|
64
63
|
|
package/src/locales.ts
CHANGED
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
import { EN_US_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-en-US';
|
|
21
21
|
import type { CheckoutScreensCopy } from './components/checkout/screens-copy';
|
|
22
22
|
import { PT_BR_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-pt-BR';
|
|
23
|
+
import { EN_US_PAYMENT_LIST_COPY } from './components/checkout/list/en-US';
|
|
24
|
+
import { PT_BR_PAYMENT_LIST_COPY } from './components/checkout/list/pt-BR';
|
|
25
|
+
import type { PaymentListCopy } from './components/checkout/list/types';
|
|
23
26
|
import type { CheckoutViewCopy, PaymentStatusCopy } from './components/checkout/view-copy';
|
|
24
27
|
import type { PlatformHomologacaoCopy } from './components/platform/copy';
|
|
25
28
|
import { EN_US_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/en-US';
|
|
@@ -76,6 +79,15 @@ export const CHECKOUT_SCREENS_COPY = {
|
|
|
76
79
|
'en-US': EN_US_CHECKOUT_SCREENS_COPY,
|
|
77
80
|
} as const satisfies LocalePack<CheckoutScreensCopy>;
|
|
78
81
|
|
|
82
|
+
/**
|
|
83
|
+
* The one-list Pagamento step's words (FUT-3591) — `CheckoutFlowProps.paymentList.copy`.
|
|
84
|
+
* Read by the SHOPPER, like every checkout pack.
|
|
85
|
+
*/
|
|
86
|
+
export const PAYMENT_LIST_COPY = {
|
|
87
|
+
'pt-BR': PT_BR_PAYMENT_LIST_COPY,
|
|
88
|
+
'en-US': EN_US_PAYMENT_LIST_COPY,
|
|
89
|
+
} as const satisfies LocalePack<PaymentListCopy>;
|
|
90
|
+
|
|
79
91
|
export const CHECKOUT_COPY = {
|
|
80
92
|
'pt-BR': PT_BR_CHECKOUT_COPY,
|
|
81
93
|
'en-US': EN_US_CHECKOUT_COPY,
|
|
@@ -123,6 +135,7 @@ export {
|
|
|
123
135
|
EN_US_PAYMENT_STATUS_COPY,
|
|
124
136
|
} from './components/checkout/en-US';
|
|
125
137
|
export { EN_US_CHECKOUT_SCREENS_COPY } from './components/checkout/screens-en-US';
|
|
138
|
+
export { EN_US_PAYMENT_LIST_COPY } from './components/checkout/list/en-US';
|
|
126
139
|
export { EN_US_PAYMENTS_SETTINGS_COPY } from './components/settings-en-US';
|
|
127
140
|
export { EN_US_PLATFORM_HOMOLOGACAO_COPY } from './components/platform/en-US';
|
|
128
141
|
export { EN_US_TENDER_SPLIT_COPY } from './tender-split/en-US';
|