@dynamic-labs-sdk/react-ui 1.52.1 → 1.52.3

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.
Files changed (50) hide show
  1. package/dist/flow/components/FlowTermsConsent/FlowTermsConsent.d.ts +74 -0
  2. package/dist/flow/components/FlowTermsConsent/FlowTermsConsent.d.ts.map +1 -0
  3. package/dist/flow/components/FlowTermsConsent/index.d.ts +3 -0
  4. package/dist/flow/components/FlowTermsConsent/index.d.ts.map +1 -0
  5. package/dist/flow/constants.d.ts +12 -0
  6. package/dist/flow/constants.d.ts.map +1 -1
  7. package/dist/flow/hooks/useFlowTermsConsent/index.d.ts +3 -0
  8. package/dist/flow/hooks/useFlowTermsConsent/index.d.ts.map +1 -0
  9. package/dist/flow/hooks/useFlowTermsConsent/useFlowTermsConsent.d.ts +42 -0
  10. package/dist/flow/hooks/useFlowTermsConsent/useFlowTermsConsent.d.ts.map +1 -0
  11. package/dist/flow/utils/resolveFlowTermsUrl/index.d.ts +3 -0
  12. package/dist/flow/utils/resolveFlowTermsUrl/index.d.ts.map +1 -0
  13. package/dist/flow/utils/resolveFlowTermsUrl/resolveFlowTermsUrl.d.ts +23 -0
  14. package/dist/flow/utils/resolveFlowTermsUrl/resolveFlowTermsUrl.d.ts.map +1 -0
  15. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.d.ts +8 -1
  16. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.d.ts.map +1 -1
  17. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.d.ts +5 -0
  18. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.d.ts.map +1 -1
  19. package/dist/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/getFlowDepositAddressQrMessageKey.d.ts +45 -0
  20. package/dist/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/getFlowDepositAddressQrMessageKey.d.ts.map +1 -0
  21. package/dist/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/index.d.ts +3 -0
  22. package/dist/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/index.d.ts.map +1 -0
  23. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/index.d.ts +3 -0
  24. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/index.d.ts.map +1 -0
  25. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/useFlowDepositAddressTermsGate.d.ts +48 -0
  26. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/useFlowDepositAddressTermsGate.d.ts.map +1 -0
  27. package/dist/flow/views/FlowExchangeView/FlowExchangeView.d.ts +6 -1
  28. package/dist/flow/views/FlowExchangeView/FlowExchangeView.d.ts.map +1 -1
  29. package/dist/flow/views/FlowExchangeView/FlowExchangeView.text.d.ts +3 -0
  30. package/dist/flow/views/FlowExchangeView/FlowExchangeView.text.d.ts.map +1 -1
  31. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.d.ts +3 -1
  32. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.d.ts.map +1 -1
  33. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.d.ts +1 -0
  34. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.d.ts.map +1 -1
  35. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.d.ts +12 -17
  36. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.d.ts.map +1 -1
  37. package/dist/flow.cjs +294 -68
  38. package/dist/flow.cjs.map +1 -1
  39. package/dist/flow.css +1 -1
  40. package/dist/flow.esm.js +294 -68
  41. package/dist/flow.esm.js.map +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.css +1 -1
  44. package/dist/index.esm.js +1 -1
  45. package/dist/{package-DC3rhvWk.esm.js → package-BF1tVvUS.esm.js} +2 -2
  46. package/dist/{package-DC3rhvWk.esm.js.map → package-BF1tVvUS.esm.js.map} +1 -1
  47. package/dist/{package-BHItweTV.cjs → package-js0iaGOF.cjs} +2 -2
  48. package/dist/{package-BHItweTV.cjs.map → package-js0iaGOF.cjs.map} +1 -1
  49. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  50. package/package.json +6 -6
@@ -0,0 +1,74 @@
1
+ import type { FC } from 'react';
2
+ /**
3
+ * Props for {@link FlowTermsConsent}.
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const props: FlowTermsConsentProps = {
8
+ * checked: false,
9
+ * consentText: 'I agree to the {terms}',
10
+ * disclaimerText: 'You can lose funds.',
11
+ * onCheckedChange: setAccepted,
12
+ * termsText: 'Terms of Service',
13
+ * termsUrl: 'https://example.com/terms',
14
+ * };
15
+ * ```
16
+ * @see FlowTermsConsent
17
+ * @see CheckboxField
18
+ */
19
+ export type FlowTermsConsentProps = {
20
+ /** Whether the payer has accepted the terms. */
21
+ checked: boolean;
22
+ className?: string;
23
+ /** The consent sentence, with a {terms} placeholder where the link goes. */
24
+ consentText: string;
25
+ /** Locks the checkbox while the screen is busy. */
26
+ disabled?: boolean;
27
+ /** Stands in for the consent sentence when there is no safe terms link. */
28
+ disclaimerText: string;
29
+ /** Fires with the payer's choice when the row is toggled. */
30
+ onCheckedChange: (checked: boolean) => void;
31
+ /** The text of the terms link. */
32
+ termsText: string;
33
+ /** Where the terms link points; it opens in a new tab. Without a safe web link, the row shows the disclaimer instead. */
34
+ termsUrl?: string;
35
+ };
36
+ /**
37
+ * The Flow terms consent: a checkbox row whose sentence carries a link to the
38
+ * terms of service. Following the link opens the terms in a new tab without
39
+ * toggling the checkbox. Without a terms link the row carries a risk
40
+ * disclaimer instead. Every payment method's screen renders it above the
41
+ * action it gates.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * import { FlowTermsConsent } from '@/flow/components/FlowTermsConsent';
46
+ *
47
+ * const App = () => (
48
+ * <FlowTermsConsent
49
+ * checked={accepted}
50
+ * consentText="I agree to the {terms}"
51
+ * disclaimerText="You can lose funds."
52
+ * onCheckedChange={setAccepted}
53
+ * termsText="Terms of Service"
54
+ * termsUrl="https://example.com/terms"
55
+ * />
56
+ * );
57
+ * ```
58
+ * @param params.checked - Whether the payer has accepted the terms.
59
+ * @param params.className - Extra class names for the root element.
60
+ * @param params.consentText - The consent sentence, with {terms} where the link goes.
61
+ * @param params.disabled - Locks the checkbox while the screen is busy.
62
+ * @param params.disclaimerText - The sentence shown instead when there is no terms link.
63
+ * @param params.onCheckedChange - Fires with the payer's choice.
64
+ * @param params.termsText - The text of the terms link.
65
+ * @param params.termsUrl - Where the terms link points.
66
+ * @returns The terms consent row.
67
+ * @see FlowTermsConsentProps
68
+ * @see CheckboxField
69
+ * @see useFlowTermsConsent
70
+ * @see resolveFlowTermsUrl
71
+ * @notInstrumented
72
+ */
73
+ export declare const FlowTermsConsent: FC<FlowTermsConsentProps>;
74
+ //# sourceMappingURL=FlowTermsConsent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowTermsConsent.d.ts","sourceRoot":"","sources":["../../../../src/flow/components/FlowTermsConsent/FlowTermsConsent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,yHAAyH;IACzH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuCtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { FlowTermsConsent } from './FlowTermsConsent';
2
+ export type { FlowTermsConsentProps } from './FlowTermsConsent';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flow/components/FlowTermsConsent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -19,4 +19,16 @@ export declare const FLOW_REFUND_INITIATED_CODE = "REFUND_INITIATED";
19
19
  export declare const FLOW_EXCHANGE_NAME_TOKEN = "{exchange}";
20
20
  /** Every payment method a payer can choose, in the order the method choice lists them. */
21
21
  export declare const FLOW_PAYMENT_METHODS: readonly FlowPaymentMethod[];
22
+ /** The placeholder terms consent copy uses for the terms link. */
23
+ export declare const FLOW_TERMS_TOKEN = "{terms}";
24
+ /** Default copy for the terms consent every payment method's screen carries. */
25
+ export declare const FLOW_TERMS_CONSENT_DEFAULT_TEXT: {
26
+ consent: string;
27
+ /**
28
+ * Stands in for the consent sentence when the host sets no terms link, so a
29
+ * payer still accepts the risk of the transfer. Hosts may reword it.
30
+ */
31
+ disclaimer: string;
32
+ terms: string;
33
+ };
22
34
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/flow/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,iHAAiH;AACjH,eAAO,MAAM,qCAAqC,EAAE,SAAS,iCAAiC,EAC/D,CAAC;AAEhC,0DAA0D;AAC1D,eAAO,MAAM,4BAA4B,WAAM,CAAC;AAEhD,gGAAgG;AAChG,eAAO,MAAM,8BAA8B;;;;CAI1C,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,qBAAqB,CAAC;AAEjE,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAI5D,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/flow/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,iHAAiH;AACjH,eAAO,MAAM,qCAAqC,EAAE,SAAS,iCAAiC,EAC/D,CAAC;AAEhC,0DAA0D;AAC1D,eAAO,MAAM,4BAA4B,WAAM,CAAC;AAEhD,gGAAgG;AAChG,eAAO,MAAM,8BAA8B;;;;CAI1C,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,qBAAqB,CAAC;AAEjE,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAI5D,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,gFAAgF;AAChF,eAAO,MAAM,+BAA+B;;IAE1C;;;OAGG;;;CAIJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useFlowTermsConsent } from './useFlowTermsConsent';
2
+ export type { UseFlowTermsConsentParams, UseFlowTermsConsentResult, } from './useFlowTermsConsent';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flow/hooks/useFlowTermsConsent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { Flow } from '@dynamic-labs-sdk/client';
2
+ /**
3
+ * Inputs for {@link useFlowTermsConsent}.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const params: UseFlowTermsConsentParams = { flow };
8
+ * ```
9
+ * @see useFlowTermsConsent
10
+ * @see Flow
11
+ */
12
+ export type UseFlowTermsConsentParams = {
13
+ /** The flow being paid, whose own terms link is used when the host sets none. Omit before it exists. */
14
+ flow?: Flow;
15
+ };
16
+ /** What a screen needs to render the terms consent and gate its action on it. */
17
+ export type UseFlowTermsConsentResult = {
18
+ /** Whether the payer has ticked the consent. */
19
+ hasAcceptedTerms: boolean;
20
+ /** Records the payer's choice; stable between renders. */
21
+ onCheckedChange: (checked: boolean) => void;
22
+ /** A safe link to the terms: the host's, else the flow's. Undefined when there is none, and the consent shows its disclaimer instead. */
23
+ termsUrl: string | undefined;
24
+ };
25
+ /**
26
+ * Tracks whether the payer accepted the terms and resolves the link they open.
27
+ * The consent is always required: a link that is missing or not safe to open
28
+ * is left out, and the consent shows its disclaimer instead of a terms link.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * const { hasAcceptedTerms, onCheckedChange, termsUrl } = useFlowTermsConsent({ flow });
33
+ * ```
34
+ * @param params.flow - The flow being paid.
35
+ * @returns The consent state, its setter and the terms link.
36
+ * @see FlowTermsConsent
37
+ * @see useFlowUiSettings
38
+ * @see resolveFlowTermsUrl
39
+ * @notInstrumented
40
+ */
41
+ export declare const useFlowTermsConsent: ({ flow, }: UseFlowTermsConsentParams) => UseFlowTermsConsentResult;
42
+ //# sourceMappingURL=useFlowTermsConsent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFlowTermsConsent.d.ts","sourceRoot":"","sources":["../../../../src/flow/hooks/useFlowTermsConsent/useFlowTermsConsent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAMrD;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,wGAAwG;IACxG,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,yBAAyB,GAAG;IACtC,gDAAgD;IAChD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0DAA0D;IAC1D,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,yIAAyI;IACzI,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,cAE7B,yBAAyB,KAAG,yBAU9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { resolveFlowTermsUrl } from './resolveFlowTermsUrl';
2
+ export type { ResolveFlowTermsUrlParams } from './resolveFlowTermsUrl';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flow/utils/resolveFlowTermsUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /** Params for {@link resolveFlowTermsUrl}. */
2
+ export type ResolveFlowTermsUrlParams = {
3
+ /** The terms link to check. */
4
+ url: string | undefined;
5
+ };
6
+ /**
7
+ * Returns a terms link that is safe to open: the given one when it is a web
8
+ * link, else nothing. A malformed link or one with another scheme, such as
9
+ * `javascript:`, never reaches an `href`.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * resolveFlowTermsUrl({ url: 'https://example.test/terms' }); // 'https://example.test/terms'
14
+ * resolveFlowTermsUrl({ url: 'javascript:alert(1)' }); // undefined
15
+ * ```
16
+ * @param params.url - The terms link to check.
17
+ * @returns The safe terms link, or undefined when there is none to open.
18
+ * @see assertSafeNavigationUrl
19
+ * @see useFlowTermsConsent
20
+ * @notInstrumented
21
+ */
22
+ export declare const resolveFlowTermsUrl: ({ url, }: ResolveFlowTermsUrlParams) => string | undefined;
23
+ //# sourceMappingURL=resolveFlowTermsUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveFlowTermsUrl.d.ts","sourceRoot":"","sources":["../../../../src/flow/utils/resolveFlowTermsUrl/resolveFlowTermsUrl.ts"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,MAAM,MAAM,yBAAyB,GAAG;IACtC,+BAA+B;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,aAE7B,yBAAyB,KAAG,MAAM,GAAG,SAcvC,CAAC"}
@@ -61,7 +61,8 @@ export type FlowDepositAddressViewProps = {
61
61
  * exactly" amount card with a {@link CopyText} for the bare amount, a
62
62
  * {@link FlowPaymentLedger} of order total and network fee, a
63
63
  * {@link CopyField} for the address, and a {@link FlowStatusTray} that
64
- * announces the awaited amount. Without a valid address for the picked chain
64
+ * announces the awaited amount, all of which stay hidden until the payer
65
+ * accepts the terms. Without a valid address for the picked chain
65
66
  * family in `refundAddresses`, a
66
67
  * {@link FlowRefundAddressSheet} slides up over the screen to ask for one before
67
68
  * anything is quoted.
@@ -90,7 +91,12 @@ export type FlowDepositAddressViewProps = {
90
91
  * @see FlowDepositAddressViewProps
91
92
  * @see getFlowDepositAddressSourceTokenOptions
92
93
  * @see FlowRefundAddressSheet
94
+ * @see FlowTermsConsent
93
95
  * @copy title - The centered header title.
96
+ * @copy consent - Consent sentence with a {terms} placeholder for the link.
97
+ * @copy disclaimer - Consent sentence shown instead when no terms link is set.
98
+ * @copy terms - Accessible text of the terms link.
99
+ * @copy showDepositAddress - The button revealing the deposit details once the terms are accepted.
94
100
  * @copy selectChainLabel - The chain select's label.
95
101
  * @copy selectChainPlaceholder - The chain select's placeholder.
96
102
  * @copy selectTokenLabel - The token select's label.
@@ -98,6 +104,7 @@ export type FlowDepositAddressViewProps = {
98
104
  * @copy qrPlaceholder - The QR placeholder's loading message while no quote is live.
99
105
  * @copy qrQuoting - The QR placeholder's loading message while a quote is in flight.
100
106
  * @copy quoteFailed - The failure banner's message when the last source could not be quoted.
107
+ * @copy qrAcceptTerms - The QR placeholder's message while a quote is ready but the payer has not agreed yet.
101
108
  * @copy qrLabel - The QR code's accessible label once the payment link is set.
102
109
  * @copy sendExactly - The amount card's small-caps title.
103
110
  * @copy amountLabel - What the amount's copy button copies, used in its accessible name.
@@ -1 +1 @@
1
- {"version":3,"file":"FlowDepositAddressView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiBhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAG5E;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC5D,wHAAwH;IACxH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAiKlE,CAAC"}
1
+ {"version":3,"file":"FlowDepositAddressView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmBhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAG5E;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC5D,wHAAwH;IACxH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAoMlE,CAAC"}
@@ -3,8 +3,11 @@
3
3
  */
4
4
  export declare const FLOW_DEPOSIT_ADDRESS_VIEW_TEXT: {
5
5
  amountLabel: string;
6
+ consent: string;
7
+ disclaimer: string;
6
8
  fees: string;
7
9
  orderTotal: string;
10
+ qrAcceptTerms: string;
8
11
  qrLabel: string;
9
12
  qrPlaceholder: string;
10
13
  qrQuoting: string;
@@ -14,6 +17,8 @@ export declare const FLOW_DEPOSIT_ADDRESS_VIEW_TEXT: {
14
17
  selectTokenLabel: string;
15
18
  selectTokenPlaceholder: string;
16
19
  sendExactly: string;
20
+ showDepositAddress: string;
21
+ terms: string;
17
22
  title: string;
18
23
  toThisAddress: string;
19
24
  waitingForAmount: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FlowDepositAddressView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;CAiB1C,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,+BAA+B,EAAE,OAAO,8BAA8B,CAAC;KACxE;CACF"}
1
+ {"version":3,"file":"FlowDepositAddressView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;CAsB1C,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,+BAA+B,EAAE,OAAO,8BAA8B,CAAC;KACxE;CACF"}
@@ -0,0 +1,45 @@
1
+ import type { FLOW_DEPOSIT_ADDRESS_VIEW_TEXT } from '../FlowDepositAddressView.text';
2
+ /**
3
+ * Inputs for {@link getFlowDepositAddressQrMessageKey}.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const params: GetFlowDepositAddressQrMessageKeyParams = {
8
+ * areDetailsRevealed: false,
9
+ * hasQuote: true,
10
+ * isQuoting: false,
11
+ * };
12
+ * ```
13
+ * @see getFlowDepositAddressQrMessageKey
14
+ */
15
+ export type GetFlowDepositAddressQrMessageKeyParams = {
16
+ /** Whether the payer accepted the terms and went on, so the details show. */
17
+ areDetailsRevealed: boolean;
18
+ /** Whether a quote with the deposit details is ready. */
19
+ hasQuote: boolean;
20
+ /** Whether a quote is being fetched. */
21
+ isQuoting: boolean;
22
+ };
23
+ /**
24
+ * Picks the message shown on the deposit address QR placeholder: progress
25
+ * while a quote is fetched, a prompt to accept the terms once a quote is ready
26
+ * but its details are held back, else the prompt to pick a chain and token.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const key = getFlowDepositAddressQrMessageKey({
31
+ * areDetailsRevealed: false,
32
+ * hasQuote: true,
33
+ * isQuoting: false,
34
+ * });
35
+ * ```
36
+ * @param params.areDetailsRevealed - Whether the payer accepted the terms and went on.
37
+ * @param params.hasQuote - Whether a quote with the deposit details is ready.
38
+ * @param params.isQuoting - Whether a quote is being fetched.
39
+ * @returns The text key of the placeholder message.
40
+ * @see GetFlowDepositAddressQrMessageKeyParams
41
+ * @see FlowDepositAddressView
42
+ * @notInstrumented
43
+ */
44
+ export declare const getFlowDepositAddressQrMessageKey: ({ areDetailsRevealed, hasQuote, isQuoting, }: GetFlowDepositAddressQrMessageKeyParams) => keyof typeof FLOW_DEPOSIT_ADDRESS_VIEW_TEXT;
45
+ //# sourceMappingURL=getFlowDepositAddressQrMessageKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFlowDepositAddressQrMessageKey.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/getFlowDepositAddressQrMessageKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,6EAA6E;IAC7E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iCAAiC,iDAI3C,uCAAuC,KAAG,MAAM,OAAO,8BAUzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getFlowDepositAddressQrMessageKey } from './getFlowDepositAddressQrMessageKey';
2
+ export type { GetFlowDepositAddressQrMessageKeyParams } from './getFlowDepositAddressQrMessageKey';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowDepositAddressView/getFlowDepositAddressQrMessageKey/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,YAAY,EAAE,uCAAuC,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useFlowDepositAddressTermsGate } from './useFlowDepositAddressTermsGate';
2
+ export type { UseFlowDepositAddressTermsGateParams, UseFlowDepositAddressTermsGateResult, } from './useFlowDepositAddressTermsGate';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EACV,oCAAoC,EACpC,oCAAoC,GACrC,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { Flow } from '@dynamic-labs-sdk/client';
2
+ import type { UseFlowTermsConsentResult } from '../../../hooks/useFlowTermsConsent';
3
+ /**
4
+ * Inputs for {@link useFlowDepositAddressTermsGate}.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const params: UseFlowDepositAddressTermsGateParams = { flow, hasQuote: true };
9
+ * ```
10
+ * @see useFlowDepositAddressTermsGate
11
+ * @see Flow
12
+ */
13
+ export type UseFlowDepositAddressTermsGateParams = {
14
+ /** The flow being funded, whose own terms link is used when the host sets none. */
15
+ flow?: Flow;
16
+ /** Whether a quote with the deposit details is ready to show. */
17
+ hasQuote: boolean;
18
+ };
19
+ /** What the deposit address screen needs to hold its details back behind the terms. */
20
+ export type UseFlowDepositAddressTermsGateResult = UseFlowTermsConsentResult & {
21
+ /** Records that the payer went on after accepting; reveals the deposit details. */
22
+ confirmTerms: () => void;
23
+ /** Whether the payer accepted and went on. */
24
+ hasConfirmedTerms: boolean;
25
+ /** Whether the terms are asked for now: a quote is ready and the payer hasn't gone on. */
26
+ isPromptShown: boolean;
27
+ };
28
+ /**
29
+ * Holds the deposit details back until the payer accepts the terms and goes
30
+ * on. The terms are only asked for once a quote is ready, so the payer sees
31
+ * them when there is something to reveal, not while still picking a chain.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * const { confirmTerms, isPromptShown } = useFlowDepositAddressTermsGate({
36
+ * flow,
37
+ * hasQuote: true,
38
+ * });
39
+ * ```
40
+ * @param params.flow - The flow being funded.
41
+ * @param params.hasQuote - Whether a quote with the deposit details is ready.
42
+ * @returns The consent state, the confirm action and whether to prompt.
43
+ * @see useFlowTermsConsent
44
+ * @see FlowDepositAddressView
45
+ * @notInstrumented
46
+ */
47
+ export declare const useFlowDepositAddressTermsGate: ({ flow, hasQuote, }: UseFlowDepositAddressTermsGateParams) => UseFlowDepositAddressTermsGateResult;
48
+ //# sourceMappingURL=useFlowDepositAddressTermsGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFlowDepositAddressTermsGate.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowDepositAddressView/useFlowDepositAddressTermsGate/useFlowDepositAddressTermsGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAGpF;;;;;;;;;GASG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,mFAAmF;IACnF,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,oCAAoC,GAAG,yBAAyB,GAAG;IAC7E,mFAAmF;IACnF,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8CAA8C;IAC9C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0FAA0F;IAC1F,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B,wBAGxC,oCAAoC,KAAG,oCAczC,CAAC"}
@@ -36,7 +36,8 @@ export type FlowExchangeViewProps = {
36
36
  /**
37
37
  * The Flow screen where the payer buys the payment amount on an exchange,
38
38
  * then waits on it until the exchange confirms the purchase; it shows
39
- * progress and failures while a new link is fetched.
39
+ * progress and failures while a new link is fetched. The payer accepts the
40
+ * terms to enable Continue, or Reopen when the screen resumes already opened.
40
41
  *
41
42
  * @example
42
43
  * ```tsx
@@ -63,13 +64,17 @@ export type FlowExchangeViewProps = {
63
64
  * @see FlowExchangeViewProps
64
65
  * @see FlowChooseExchangeView
65
66
  * @see FlowStatusTray
67
+ * @see FlowTermsConsent
68
+ * @copy consent - Consent sentence with a {terms} placeholder for the link.
66
69
  * @copy continue - The primary action opening {exchange}.
70
+ * @copy disclaimer - Consent sentence shown instead when no terms link is set.
67
71
  * @copy heading - What the payer buys: {amount} on {exchange}.
68
72
  * @copy incompatibleError - Shown when {exchange} can't be used for this payment.
69
73
  * @copy openHint - Says {exchange} opens in a new tab.
70
74
  * @copy renewingStatus - The progress line while a new {exchange} link is fetched.
71
75
  * @copy reopen - The secondary action opening {exchange} again.
72
76
  * @copy temporaryError - Shown when {exchange} isn't responding.
77
+ * @copy terms - Accessible text of the terms link.
73
78
  * @copy title - The centered header title naming {exchange}.
74
79
  * @copy unavailableError - Shown when {exchange} isn't offered for this payment.
75
80
  * @copy unknownError - Shown when a new {exchange} link failed unexpectedly.
@@ -1 +1 @@
1
- {"version":3,"file":"FlowExchangeView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowExchangeView/FlowExchangeView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAWhC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAOpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,8DAA8D;IAC9D,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,gFAAgF;IAChF,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyEtD,CAAC"}
1
+ {"version":3,"file":"FlowExchangeView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowExchangeView/FlowExchangeView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAQpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,8DAA8D;IAC9D,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,gFAAgF;IAChF,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA6FtD,CAAC"}
@@ -1,12 +1,15 @@
1
1
  /** Default text for {@link FlowExchangeView}. */
2
2
  export declare const FLOW_EXCHANGE_VIEW_TEXT: {
3
+ consent: string;
3
4
  continue: string;
5
+ disclaimer: string;
4
6
  heading: string;
5
7
  incompatibleError: string;
6
8
  openHint: string;
7
9
  renewingStatus: string;
8
10
  reopen: string;
9
11
  temporaryError: string;
12
+ terms: string;
10
13
  title: string;
11
14
  unavailableError: string;
12
15
  unknownError: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FlowExchangeView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowExchangeView/FlowExchangeView.text.ts"],"names":[],"mappings":"AAEA,iDAAiD;AACjD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAanC,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,wBAAwB,EAAE,OAAO,uBAAuB,CAAC;KAC1D;CACF"}
1
+ {"version":3,"file":"FlowExchangeView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowExchangeView/FlowExchangeView.text.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;CAgBnC,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,wBAAwB,EAAE,OAAO,uBAAuB,CAAC;KAC1D;CACF"}
@@ -34,7 +34,7 @@ export type FlowReviewPaymentViewProps = {
34
34
  };
35
35
  /**
36
36
  * The Flow review screen: quoted payment assets, fee estimates, and
37
- * optional terms consent before confirming payment through the parent. It
37
+ * terms consent before confirming payment through the parent. It
38
38
  * counts down the quote and, once it expires, offers a new one instead.
39
39
  * @example
40
40
  * ```tsx
@@ -57,9 +57,11 @@ export type FlowReviewPaymentViewProps = {
57
57
  * @see FlowReviewPaymentViewProps
58
58
  * @see FlowPaymentSwapTile
59
59
  * @see FlowPaymentLedger
60
+ * @see FlowTermsConsent
60
61
  * @copy back - Footer action returning to the previous step.
61
62
  * @copy confirm - Action confirming the reviewed payment.
62
63
  * @copy consent - Consent sentence with a {terms} placeholder for the link.
64
+ * @copy disclaimer - Consent sentence shown instead when no terms link is set.
63
65
  * @copy fees - Label for quoted fees.
64
66
  * @copy orderTotal - Ledger label for the order amount before fees.
65
67
  * @copy quoteExpiresIn - Countdown at the bottom of the panel; `{time}` is replaced by the time left.
@@ -1 +1 @@
1
- {"version":3,"file":"FlowReviewPaymentView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAWhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAQ5F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,6FAA6F;IAC7F,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,4FAA4F;IAC5F,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,kGAAkG;IAClG,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAqHhE,CAAC"}
1
+ {"version":3,"file":"FlowReviewPaymentView.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAQ5F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,6FAA6F;IAC7F,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,4FAA4F;IAC5F,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,kGAAkG;IAClG,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CA0GhE,CAAC"}
@@ -3,6 +3,7 @@ export declare const FLOW_REVIEW_PAYMENT_VIEW_TEXT: {
3
3
  back: string;
4
4
  confirm: string;
5
5
  consent: string;
6
+ disclaimer: string;
6
7
  fees: string;
7
8
  /** The inline error's re-quote action for an expired quote. */
8
9
  getNewQuote: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FlowReviewPaymentView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,eAAO,MAAM,6BAA6B;;;;;IAKxC,+DAA+D;;;IAG/D,mFAAmF;;IAEnF,qEAAqE;;IAErE,iDAAiD;;IAEjD,mEAAmE;;IAEnE,sEAAsE;;IAEtE,yEAAyE;;;;;IAKzE,uCAAuC;;IAEvC,6DAA6D;;CAE9D,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,8BAA8B,EAAE,OAAO,6BAA6B,CAAC;KACtE;CACF"}
1
+ {"version":3,"file":"FlowReviewPaymentView.text.d.ts","sourceRoot":"","sources":["../../../../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.ts"],"names":[],"mappings":"AAKA,sDAAsD;AACtD,eAAO,MAAM,6BAA6B;;;;;;IAMxC,+DAA+D;;;IAG/D,mFAAmF;;IAEnF,qEAAqE;;IAErE,iDAAiD;;IAEjD,mEAAmE;;IAEnE,sEAAsE;;IAEtE,yEAAyE;;;;;IAKzE,uCAAuC;;IAEvC,6DAA6D;;CAE9D,CAAC;AAEF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,SAAS;QACjB,8BAA8B,EAAE,OAAO,6BAA6B,CAAC;KACtE;CACF"}
@@ -6,7 +6,7 @@ import type { SubmitTransactionErrorType } from '../../../utils/getSubmitTransac
6
6
  * @example
7
7
  * ```ts
8
8
  * const params: UseFlowReviewPaymentViewParams = {
9
- * consentText: 'I agree to the {terms}', flow,
9
+ * flow, hasAcceptedTerms: true,
10
10
  * isConfirmingPayment: false, isRequoting: false,
11
11
  * };
12
12
  * ```
@@ -14,10 +14,10 @@ import type { SubmitTransactionErrorType } from '../../../utils/getSubmitTransac
14
14
  * @see FlowReviewPaymentView
15
15
  */
16
16
  export type UseFlowReviewPaymentViewParams = {
17
- /** Localized consent sentence, with a {terms} placeholder for the link. */
18
- consentText: string;
19
17
  /** SDK flow being reviewed. */
20
18
  flow: Flow;
19
+ /** Whether the payer ticked the terms consent; payment can't be confirmed before. */
20
+ hasAcceptedTerms: boolean;
21
21
  /** Whether the parent has started confirming payment. */
22
22
  isConfirmingPayment: boolean;
23
23
  /** Whether a new quote is being fetched. */
@@ -29,44 +29,39 @@ export type UseFlowReviewPaymentViewParams = {
29
29
  /** The kind of the last submission's failure. */
30
30
  submitTransactionErrorType?: SubmitTransactionErrorType;
31
31
  };
32
- /** Consent state and presentation values returned to the review screen. */
32
+ /** Confirmation availability and presentation values returned to the review screen. */
33
33
  export type UseFlowReviewPaymentViewResult = {
34
- afterTermsText: string | undefined;
35
- beforeTermsText: string | undefined;
36
34
  canConfirmPayment: boolean;
37
35
  /** The inline error's recovery action; hidden while confirming or fetching a new quote. */
38
36
  errorAction: (() => void) | undefined;
39
37
  /** The inline error to show — a submission failure, else an expired quote. */
40
38
  errorType: SubmitTransactionErrorType | undefined;
41
- hasAcceptedTerms: boolean;
42
- onCheckedChange: (checked: boolean) => void;
43
39
  paymentData: FormattedFlowPayment;
44
40
  /** How long the quote is still valid for, as `m:ss`; `undefined` once expired or while confirming. */
45
41
  quoteTimeLeft: string | undefined;
46
- termsUrl: string | undefined;
47
42
  };
48
43
  /**
49
- * Tracks terms acceptance and the quote's expiry, and derives whether the
50
- * payment can be confirmed and which inline error to show.
44
+ * Tracks the quote's expiry, and derives whether the payment can be confirmed
45
+ * and which inline error to show.
51
46
  * @example
52
47
  * ```tsx
53
- * const { canConfirmPayment, hasAcceptedTerms, onCheckedChange } = useFlowReviewPaymentView({
54
- * consentText: 'I agree to the {terms}', flow,
48
+ * const { canConfirmPayment, errorType } = useFlowReviewPaymentView({
49
+ * flow, hasAcceptedTerms: true,
55
50
  * isConfirmingPayment: false, isRequoting: false,
56
51
  * });
57
52
  * ```
58
- * @param params.consentText - Localized sentence containing {terms}.
59
53
  * @param params.flow - SDK flow being reviewed.
54
+ * @param params.hasAcceptedTerms - Whether the payer ticked the terms consent.
60
55
  * @param params.isConfirmingPayment - Whether confirmation has started.
61
56
  * @param params.isRequoting - Whether a new quote is being fetched.
62
57
  * @param params.onRequote - Fetches a new quote once the current one expires.
63
58
  * @param params.onSubmitErrorAction - The recovery action for the last submission's failure.
64
59
  * @param params.submitTransactionErrorType - The kind of the last submission's failure.
65
- * @returns Consent controls, safe terms URL, the quote's time left, the inline error and confirmation availability.
60
+ * @returns The quote's time left, the inline error and confirmation availability.
66
61
  * @see FlowReviewPaymentView
67
- * @see assertSafeNavigationUrl
62
+ * @see useFlowTermsConsent
68
63
  * @see useQuoteCountdown
69
64
  * @notInstrumented
70
65
  */
71
- export declare const useFlowReviewPaymentView: ({ consentText, flow, isConfirmingPayment, isRequoting, onRequote, onSubmitErrorAction, submitTransactionErrorType, }: UseFlowReviewPaymentViewParams) => UseFlowReviewPaymentViewResult;
66
+ export declare const useFlowReviewPaymentView: ({ flow, hasAcceptedTerms, isConfirmingPayment, isRequoting, onRequote, onSubmitErrorAction, submitTransactionErrorType, }: UseFlowReviewPaymentViewParams) => UseFlowReviewPaymentViewResult;
72
67
  //# sourceMappingURL=useFlowReviewPaymentView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFlowReviewPaymentView.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAI/F;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,yDAAyD;IACzD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iDAAiD;IACjD,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,8BAA8B,GAAG;IAC3C,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2FAA2F;IAC3F,WAAW,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACtC,8EAA8E;IAC9E,SAAS,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAClD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,oBAAoB,CAAC;IAClC,sGAAsG;IACtG,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,yHAQlC,8BAA8B,KAAG,8BAsDnC,CAAC"}
1
+ {"version":3,"file":"useFlowReviewPaymentView.d.ts","sourceRoot":"","sources":["../../../../../src/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAI/F;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,+BAA+B;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,qFAAqF;IACrF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iDAAiD;IACjD,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACzD,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2FAA2F;IAC3F,WAAW,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACtC,8EAA8E;IAC9E,SAAS,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAClD,WAAW,EAAE,oBAAoB,CAAC;IAClC,sGAAsG;IACtG,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,8HAQlC,8BAA8B,KAAG,8BA4BnC,CAAC"}