@paypal/checkout-components 5.0.256 → 5.0.258
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/README.md +8 -0
- package/__sdk__.js +72 -76
- package/dist/button.js +1 -1
- package/globals.js +28 -30
- package/package.json +6 -4
- package/src/constants/button.js +37 -36
- package/src/constants/class.js +32 -30
- package/src/constants/index.js +3 -3
- package/src/constants/misc.js +14 -12
- package/src/declarations.js +19 -19
- package/src/funding/applepay/config.jsx +51 -50
- package/src/funding/applepay/index.js +1 -1
- package/src/funding/applepay/style.scoped.scss +1 -1
- package/src/funding/applepay/template.jsx +16 -11
- package/src/funding/bancontact/config.jsx +48 -37
- package/src/funding/bancontact/index.js +1 -2
- package/src/funding/blik/config.jsx +48 -37
- package/src/funding/blik/index.js +1 -2
- package/src/funding/boleto/config.jsx +50 -39
- package/src/funding/boleto/index.js +1 -2
- package/src/funding/card/amex/config.js +9 -8
- package/src/funding/card/amex/index.js +1 -2
- package/src/funding/card/config.jsx +246 -177
- package/src/funding/card/discover/config.js +9 -7
- package/src/funding/card/discover/index.js +1 -2
- package/src/funding/card/elo/config.js +6 -7
- package/src/funding/card/elo/index.js +1 -2
- package/src/funding/card/hiper/config.js +9 -7
- package/src/funding/card/hiper/index.js +1 -2
- package/src/funding/card/index.js +1 -1
- package/src/funding/card/jcb/config.js +6 -7
- package/src/funding/card/jcb/index.js +1 -2
- package/src/funding/card/mastercard/config.js +9 -7
- package/src/funding/card/mastercard/index.js +1 -2
- package/src/funding/card/visa/config.js +9 -7
- package/src/funding/card/visa/index.js +1 -2
- package/src/funding/common.jsx +242 -216
- package/src/funding/config.js +212 -65
- package/src/funding/content.jsx +1946 -337
- package/src/funding/credit/config.jsx +74 -57
- package/src/funding/credit/index.js +1 -2
- package/src/funding/eps/config.jsx +45 -37
- package/src/funding/eps/index.js +1 -2
- package/src/funding/funding.js +193 -100
- package/src/funding/giropay/config.jsx +48 -38
- package/src/funding/giropay/index.js +1 -2
- package/src/funding/ideal/config.jsx +48 -37
- package/src/funding/ideal/index.js +1 -2
- package/src/funding/index.js +2 -2
- package/src/funding/itau/config.jsx +41 -41
- package/src/funding/itau/index.js +1 -1
- package/src/funding/maxima/config.jsx +25 -19
- package/src/funding/maxima/index.js +1 -2
- package/src/funding/mercadopago/config.jsx +48 -37
- package/src/funding/mercadopago/index.js +1 -2
- package/src/funding/multibanco/config.jsx +50 -39
- package/src/funding/multibanco/index.js +1 -2
- package/src/funding/mybank/config.jsx +48 -37
- package/src/funding/mybank/index.js +1 -2
- package/src/funding/oxxo/config.jsx +50 -39
- package/src/funding/oxxo/index.js +1 -2
- package/src/funding/p24/config.jsx +45 -37
- package/src/funding/p24/index.js +1 -2
- package/src/funding/paidy/config.jsx +50 -39
- package/src/funding/paidy/index.js +1 -1
- package/src/funding/paylater/config.jsx +118 -111
- package/src/funding/paylater/index.js +1 -2
- package/src/funding/paypal/config.jsx +44 -46
- package/src/funding/paypal/index.js +1 -2
- package/src/funding/paypal/style.scoped.scss +80 -74
- package/src/funding/paypal/template.jsx +450 -354
- package/src/funding/payu/config.jsx +50 -39
- package/src/funding/payu/index.js +1 -1
- package/src/funding/satispay/config.jsx +50 -39
- package/src/funding/satispay/index.js +1 -1
- package/src/funding/sepa/config.jsx +19 -13
- package/src/funding/sepa/index.js +1 -2
- package/src/funding/sofort/config.jsx +48 -37
- package/src/funding/sofort/index.js +1 -2
- package/src/funding/trustly/config.jsx +50 -39
- package/src/funding/trustly/index.js +1 -2
- package/src/funding/venmo/config.jsx +80 -75
- package/src/funding/venmo/index.js +1 -2
- package/src/funding/venmo/style.scoped.scss +30 -32
- package/src/funding/venmo/template.jsx +56 -57
- package/src/funding/verkkopankki/config.jsx +50 -39
- package/src/funding/verkkopankki/index.js +1 -1
- package/src/funding/wechatpay/config.jsx +48 -37
- package/src/funding/wechatpay/index.js +1 -2
- package/src/funding/zimpler/config.jsx +19 -13
- package/src/funding/zimpler/index.js +1 -2
- package/src/interface/button.js +60 -44
- package/src/interface/card-fields.js +11 -8
- package/src/interface/fields.js +7 -4
- package/src/interface/marks.js +4 -4
- package/src/interface/payment-fields.js +7 -4
- package/src/interface/wallet.js +4 -4
- package/src/lib/errors.js +7 -7
- package/src/lib/index.js +5 -5
- package/src/lib/isRTLLanguage.js +3 -3
- package/src/lib/perceived-latency-instrumentation.js +54 -36
- package/src/lib/security.js +21 -17
- package/src/lib/session.js +39 -35
- package/src/marks/component.jsx +114 -65
- package/src/marks/index.js +1 -2
- package/src/marks/template.jsx +79 -65
- package/src/types.js +48 -48
- package/src/ui/buttons/button.jsx +311 -249
- package/src/ui/buttons/buttonDesigns/control.jsx +3 -5
- package/src/ui/buttons/buttonDesigns/divideLogoAnimation.jsx +127 -99
- package/src/ui/buttons/buttonDesigns/index.js +78 -75
- package/src/ui/buttons/buttonDesigns/inlineLogoTextDesign.jsx +102 -82
- package/src/ui/buttons/buttonDesigns/script.jsx +24 -18
- package/src/ui/buttons/buttonDesigns/types.js +6 -7
- package/src/ui/buttons/buttons.jsx +318 -212
- package/src/ui/buttons/config.js +62 -59
- package/src/ui/buttons/content.jsx +304 -119
- package/src/ui/buttons/index.js +1 -1
- package/src/ui/buttons/menu-button/index.js +1 -1
- package/src/ui/buttons/menu-button/menu-button.jsx +29 -22
- package/src/ui/buttons/menu-button/menu-button.scoped.scss +16 -17
- package/src/ui/buttons/poweredBy.jsx +23 -23
- package/src/ui/buttons/props.js +680 -529
- package/src/ui/buttons/script.jsx +182 -160
- package/src/ui/buttons/spinner.jsx +4 -6
- package/src/ui/buttons/style.jsx +15 -14
- package/src/ui/buttons/styles/base.js +24 -16
- package/src/ui/buttons/styles/button.js +24 -22
- package/src/ui/buttons/styles/color.js +118 -118
- package/src/ui/buttons/styles/custom.js +30 -24
- package/src/ui/buttons/styles/index.js +1 -1
- package/src/ui/buttons/styles/labels.js +17 -13
- package/src/ui/buttons/styles/page.js +3 -3
- package/src/ui/buttons/styles/responsive.js +226 -118
- package/src/ui/buttons/tagline.jsx +53 -54
- package/src/ui/chevron.jsx +27 -16
- package/src/ui/index.js +3 -3
- package/src/ui/loading.jsx +25 -18
- package/src/ui/text/index.js +1 -1
- package/src/ui/text/style.scoped.scss +25 -26
- package/src/ui/text/text.jsx +42 -20
- package/src/ui/tracking.jsx +18 -11
- package/src/zoid/buttons/component.jsx +836 -684
- package/src/zoid/buttons/container.jsx +140 -107
- package/src/zoid/buttons/index.js +1 -1
- package/src/zoid/buttons/prerender.jsx +84 -64
- package/src/zoid/buttons/util.js +355 -254
- package/src/zoid/card-fields/component.jsx +581 -549
- package/src/zoid/card-fields/index.js +1 -1
- package/src/zoid/card-fields/prerender.jsx +20 -17
- package/src/zoid/card-form/component.js +155 -141
- package/src/zoid/card-form/index.js +1 -1
- package/src/zoid/checkout/component.jsx +314 -282
- package/src/zoid/checkout/config.js +2 -2
- package/src/zoid/checkout/content.js +190 -154
- package/src/zoid/checkout/hacks.js +31 -28
- package/src/zoid/checkout/index.js +2 -2
- package/src/zoid/checkout/props.js +27 -33
- package/src/zoid/installments/component.jsx +83 -70
- package/src/zoid/installments/index.js +1 -1
- package/src/zoid/installments/props.js +1 -1
- package/src/zoid/menu/component.jsx +53 -48
- package/src/zoid/menu/index.js +1 -1
- package/src/zoid/menu/props.js +1 -3
- package/src/zoid/modal/component.jsx +119 -106
- package/src/zoid/modal/index.js +1 -1
- package/src/zoid/modal/props.js +1 -3
- package/src/zoid/payment-fields/component.jsx +215 -191
- package/src/zoid/payment-fields/container.jsx +73 -64
- package/src/zoid/payment-fields/index.js +1 -1
- package/src/zoid/payment-fields/prerender.jsx +16 -14
- package/src/zoid/payment-fields/props.js +6 -6
- package/src/zoid/qr-code/component.jsx +131 -115
- package/src/zoid/qr-code/container.jsx +74 -68
- package/src/zoid/qr-code/index.js +1 -1
- package/src/zoid/qr-code/prerender.jsx +17 -12
- package/src/zoid/qr-code/types.js +2 -2
- package/src/zoid/wallet/component.jsx +298 -260
- package/src/zoid/wallet/container.jsx +73 -64
- package/src/zoid/wallet/index.js +1 -1
- package/src/zoid/wallet/prerender.jsx +14 -14
- package/src/zoid/wallet/props.js +4 -4
- package/src/actions/save/index.js +0 -40
- package/src/interface/actions.js +0 -14
- package/src/lib/getLogoCDNExperiment.js +0 -25
package/src/funding/common.jsx
CHANGED
|
@@ -2,253 +2,279 @@
|
|
|
2
2
|
/* eslint no-template-curly-in-string: off, max-lines: off */
|
|
3
3
|
/** @jsx node */
|
|
4
4
|
|
|
5
|
-
import { node, type ChildType } from
|
|
6
|
-
import type { FundingEligibilityType } from
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
import { node, type ChildType } from "@krakenjs/jsx-pragmatic/src";
|
|
6
|
+
import type { FundingEligibilityType } from "@paypal/sdk-client/src";
|
|
7
|
+
import {
|
|
8
|
+
PLATFORM,
|
|
9
|
+
type LocaleType,
|
|
10
|
+
COUNTRY,
|
|
11
|
+
CARD,
|
|
12
|
+
COMPONENTS,
|
|
13
|
+
FUNDING,
|
|
14
|
+
ENV,
|
|
15
|
+
} from "@paypal/sdk-constants/src";
|
|
16
|
+
import { LOGO_COLOR } from "@paypal/sdk-logos/src";
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
ContentType,
|
|
20
|
+
CustomStyle,
|
|
21
|
+
WalletInstrument,
|
|
22
|
+
Experiment,
|
|
23
|
+
Requires,
|
|
24
|
+
Wallet,
|
|
25
|
+
} from "../types";
|
|
26
|
+
import {
|
|
27
|
+
BUTTON_COLOR,
|
|
28
|
+
BUTTON_SHAPE,
|
|
29
|
+
BUTTON_LAYOUT,
|
|
30
|
+
DEFAULT,
|
|
31
|
+
BUTTON_LABEL,
|
|
32
|
+
BUTTON_FLOW,
|
|
33
|
+
TEXT_COLOR,
|
|
34
|
+
} from "../constants";
|
|
35
|
+
import type { Personalization } from "../ui/buttons/props";
|
|
36
|
+
|
|
37
|
+
import { componentContent } from "./content";
|
|
15
38
|
|
|
16
39
|
export type CardConfig = {|
|
|
17
|
-
|
|
40
|
+
Label: () => ChildType,
|
|
18
41
|
|};
|
|
19
42
|
|
|
20
43
|
export type LogoOptions = {|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
locale: LocaleType,
|
|
45
|
+
label?: ?$Values<typeof BUTTON_LABEL>,
|
|
46
|
+
logoColor?: $Values<typeof LOGO_COLOR>,
|
|
47
|
+
optional?: boolean,
|
|
48
|
+
fundingEligibility: FundingEligibilityType,
|
|
49
|
+
onClick?: (event: MouseEvent, ...args: $ReadOnlyArray<mixed>) => void,
|
|
50
|
+
onKeyPress?: (event: KeyboardEvent, ...args: $ReadOnlyArray<mixed>) => void,
|
|
51
|
+
nonce?: ?string,
|
|
52
|
+
experiment: Experiment,
|
|
53
|
+
env: $Values<typeof ENV>,
|
|
31
54
|
|};
|
|
32
55
|
|
|
33
56
|
export type LabelOptions = {|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
i: number,
|
|
58
|
+
logo: ChildType,
|
|
59
|
+
label: ?$Values<typeof BUTTON_LABEL>,
|
|
60
|
+
locale: LocaleType,
|
|
61
|
+
logoColor: $Values<typeof LOGO_COLOR>,
|
|
62
|
+
multiple: boolean,
|
|
63
|
+
period?: number,
|
|
64
|
+
fundingEligibility: FundingEligibilityType,
|
|
65
|
+
optional?: boolean,
|
|
66
|
+
onClick: (event: Event, ...args: $ReadOnlyArray<mixed>) => void,
|
|
67
|
+
onKeyPress?: (event: KeyboardEvent, ...args: $ReadOnlyArray<mixed>) => void,
|
|
68
|
+
layout: $Values<typeof BUTTON_LAYOUT>,
|
|
69
|
+
personalization: ?Personalization,
|
|
70
|
+
nonce: ?string,
|
|
71
|
+
tagline: ?boolean,
|
|
72
|
+
content: ?ContentType,
|
|
73
|
+
experiment?: Experiment,
|
|
74
|
+
custom?: ?CustomStyle,
|
|
52
75
|
|};
|
|
53
76
|
|
|
54
77
|
export type DesignExperimentLabelOptions = {|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
i: number,
|
|
79
|
+
logo: ChildType,
|
|
80
|
+
label: ?$Values<typeof BUTTON_LABEL>,
|
|
81
|
+
locale: LocaleType,
|
|
82
|
+
logoColor: $Values<typeof LOGO_COLOR>,
|
|
83
|
+
multiple: boolean,
|
|
84
|
+
period?: number,
|
|
85
|
+
fundingEligibility: FundingEligibilityType,
|
|
86
|
+
optional?: boolean,
|
|
87
|
+
onClick: (event: Event, ...args: $ReadOnlyArray<mixed>) => void,
|
|
88
|
+
onKeyPress?: (event: KeyboardEvent, ...args: $ReadOnlyArray<mixed>) => void,
|
|
89
|
+
layout: $Values<typeof BUTTON_LAYOUT>,
|
|
90
|
+
personalization: ?Personalization,
|
|
91
|
+
nonce: ?string,
|
|
92
|
+
tagline: ?boolean,
|
|
93
|
+
content: ?ContentType,
|
|
94
|
+
buttonDesignComponent: ?ChildType,
|
|
72
95
|
|};
|
|
73
96
|
|
|
74
97
|
export type WalletLabelOptions = {|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
locale: LocaleType,
|
|
99
|
+
logoColor: $Values<typeof LOGO_COLOR>,
|
|
100
|
+
instrument: ?WalletInstrument,
|
|
101
|
+
content: ?ContentType,
|
|
102
|
+
commit: boolean,
|
|
103
|
+
experiment: Experiment,
|
|
104
|
+
vault: boolean,
|
|
105
|
+
nonce?: ?string,
|
|
106
|
+
textColor: $Values<typeof TEXT_COLOR>,
|
|
107
|
+
fundingSource: $Values<typeof FUNDING>,
|
|
108
|
+
showPayLabel: boolean,
|
|
86
109
|
|};
|
|
87
110
|
|
|
88
111
|
export type TagOptions = {|
|
|
89
|
-
|
|
90
|
-
|
|
112
|
+
locale: LocaleType,
|
|
113
|
+
multiple: boolean,
|
|
91
114
|
|};
|
|
92
115
|
|
|
93
116
|
export type FundingSourceConfig = {|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
enabled: boolean,
|
|
118
|
+
automatic: boolean,
|
|
119
|
+
shippingChange?: boolean,
|
|
120
|
+
requires?: ({| platform?: $Values<typeof PLATFORM> |}) => Requires,
|
|
121
|
+
platforms: $ReadOnlyArray<$Values<typeof PLATFORM>>,
|
|
122
|
+
layouts: $ReadOnlyArray<$Values<typeof BUTTON_LAYOUT>>,
|
|
123
|
+
flows: $ReadOnlyArray<$Values<typeof BUTTON_FLOW>>,
|
|
124
|
+
maxCards?: { [$Values<typeof COUNTRY>]: number },
|
|
125
|
+
remembered?: boolean,
|
|
126
|
+
vendors?: { [$Values<typeof CARD>]: ?CardConfig },
|
|
127
|
+
eligible?: ({|
|
|
128
|
+
components: $ReadOnlyArray<$Values<typeof COMPONENTS>>,
|
|
129
|
+
experiment: ?Experiment,
|
|
130
|
+
fundingEligibility: FundingEligibilityType,
|
|
131
|
+
fundingSource: ?$Values<typeof FUNDING>,
|
|
132
|
+
layout: ?$Values<typeof BUTTON_LAYOUT>,
|
|
133
|
+
wallet: ?Wallet,
|
|
134
|
+
|}) => boolean,
|
|
135
|
+
Logo: (LogoOptions) => ChildType,
|
|
136
|
+
Mark?: () => ChildType,
|
|
137
|
+
Label: (LabelOptions) => ChildType,
|
|
138
|
+
WalletLabel?: (WalletLabelOptions) => ?ChildType,
|
|
139
|
+
Tag?: (TagOptions) => ?ChildType,
|
|
140
|
+
colors: $ReadOnlyArray<$Values<typeof BUTTON_COLOR>>,
|
|
141
|
+
textColors: { [$Values<typeof BUTTON_COLOR>]: $Values<typeof TEXT_COLOR> },
|
|
142
|
+
secondaryColors: {
|
|
143
|
+
[$Values<typeof BUTTON_COLOR>]: $Values<typeof BUTTON_COLOR>,
|
|
144
|
+
},
|
|
145
|
+
secondaryVaultColors: {
|
|
146
|
+
[$Values<typeof BUTTON_COLOR>]: $Values<typeof BUTTON_COLOR>,
|
|
147
|
+
},
|
|
148
|
+
logoColors: { [$Values<typeof BUTTON_COLOR>]: $Values<typeof LOGO_COLOR> },
|
|
149
|
+
shapes: $ReadOnlyArray<$Values<typeof BUTTON_SHAPE>>,
|
|
150
|
+
labelText?:
|
|
151
|
+
| string
|
|
152
|
+
| (({|
|
|
153
|
+
content: ?ContentType,
|
|
154
|
+
fundingEligibility: ?FundingEligibilityType,
|
|
155
|
+
|}) => string),
|
|
156
|
+
showWalletMenu: ({|
|
|
157
|
+
instrument: WalletInstrument,
|
|
158
|
+
userIDToken: ?string,
|
|
159
|
+
|}) => boolean,
|
|
125
160
|
|};
|
|
126
161
|
|
|
127
|
-
export function BasicLabel({
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
162
|
+
export function BasicLabel({
|
|
163
|
+
logo,
|
|
164
|
+
label,
|
|
165
|
+
period,
|
|
166
|
+
locale: { lang },
|
|
167
|
+
}: LabelOptions): ChildType {
|
|
168
|
+
if (__WEB__) {
|
|
169
|
+
return logo;
|
|
170
|
+
}
|
|
131
171
|
|
|
132
|
-
|
|
172
|
+
const { Checkout, Pay, BuyNow, Installment, Subscribe, Donate } =
|
|
173
|
+
componentContent[lang];
|
|
133
174
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
175
|
+
if (label === BUTTON_LABEL.CHECKOUT) {
|
|
176
|
+
return <Checkout logo={logo} />;
|
|
177
|
+
}
|
|
137
178
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (label === BUTTON_LABEL.DONATE && Donate) {
|
|
143
|
-
return <Donate logo={ logo } />;
|
|
144
|
-
}
|
|
179
|
+
if (label === BUTTON_LABEL.SUBSCRIBE && Subscribe) {
|
|
180
|
+
return <Subscribe logo={logo} />;
|
|
181
|
+
}
|
|
145
182
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
183
|
+
if (label === BUTTON_LABEL.DONATE && Donate) {
|
|
184
|
+
return <Donate logo={logo} />;
|
|
185
|
+
}
|
|
149
186
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
187
|
+
if (label === BUTTON_LABEL.PAY) {
|
|
188
|
+
return <Pay logo={logo} />;
|
|
189
|
+
}
|
|
153
190
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
191
|
+
if (label === BUTTON_LABEL.BUYNOW) {
|
|
192
|
+
return <BuyNow logo={logo} />;
|
|
193
|
+
}
|
|
157
194
|
|
|
158
|
-
|
|
195
|
+
if (label === BUTTON_LABEL.INSTALLMENT && Installment) {
|
|
196
|
+
return <Installment logo={logo} period={period} />;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return logo;
|
|
159
200
|
}
|
|
160
201
|
|
|
161
|
-
export const DEFAULT_FUNDING_CONFIG
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
],
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
[ DEFAULT ]: BUTTON_COLOR.SILVER,
|
|
208
|
-
[ BUTTON_COLOR.BLACK ]: BUTTON_COLOR.BLACK,
|
|
209
|
-
[ BUTTON_COLOR.WHITE ]: BUTTON_COLOR.WHITE
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
Logo: () => {
|
|
213
|
-
throw new Error(`Not implemented`);
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
Label: BasicLabel,
|
|
217
|
-
|
|
218
|
-
showWalletMenu: () => {
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
202
|
+
export const DEFAULT_FUNDING_CONFIG: FundingSourceConfig = {
|
|
203
|
+
enabled: true,
|
|
204
|
+
automatic: true,
|
|
205
|
+
|
|
206
|
+
layouts: [BUTTON_LAYOUT.VERTICAL],
|
|
207
|
+
|
|
208
|
+
platforms: [PLATFORM.DESKTOP, PLATFORM.MOBILE],
|
|
209
|
+
|
|
210
|
+
flows: [BUTTON_FLOW.PURCHASE],
|
|
211
|
+
|
|
212
|
+
colors: [BUTTON_COLOR.SILVER, BUTTON_COLOR.BLACK, BUTTON_COLOR.WHITE],
|
|
213
|
+
|
|
214
|
+
logoColors: {
|
|
215
|
+
[BUTTON_COLOR.BLACK]: LOGO_COLOR.WHITE,
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
shapes: [BUTTON_SHAPE.RECT, BUTTON_SHAPE.PILL],
|
|
219
|
+
|
|
220
|
+
textColors: {
|
|
221
|
+
[DEFAULT]: BUTTON_COLOR.BLACK,
|
|
222
|
+
[BUTTON_COLOR.BLUE]: BUTTON_COLOR.WHITE,
|
|
223
|
+
[BUTTON_COLOR.BLACK]: BUTTON_COLOR.WHITE,
|
|
224
|
+
[BUTTON_COLOR.DARKBLUE]: BUTTON_COLOR.WHITE,
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
secondaryColors: {
|
|
228
|
+
[DEFAULT]: BUTTON_COLOR.SILVER,
|
|
229
|
+
[BUTTON_COLOR.BLACK]: BUTTON_COLOR.BLACK,
|
|
230
|
+
[BUTTON_COLOR.WHITE]: BUTTON_COLOR.WHITE,
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
secondaryVaultColors: {
|
|
234
|
+
[DEFAULT]: BUTTON_COLOR.SILVER,
|
|
235
|
+
[BUTTON_COLOR.BLACK]: BUTTON_COLOR.BLACK,
|
|
236
|
+
[BUTTON_COLOR.WHITE]: BUTTON_COLOR.WHITE,
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
Logo: () => {
|
|
240
|
+
throw new Error(`Not implemented`);
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
Label: BasicLabel,
|
|
244
|
+
|
|
245
|
+
showWalletMenu: () => {
|
|
246
|
+
return true;
|
|
247
|
+
},
|
|
221
248
|
};
|
|
222
249
|
|
|
223
|
-
export const DEFAULT_APM_FUNDING_CONFIG
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
250
|
+
export const DEFAULT_APM_FUNDING_CONFIG: FundingSourceConfig = {
|
|
251
|
+
...DEFAULT_FUNDING_CONFIG,
|
|
252
|
+
|
|
253
|
+
colors: [
|
|
254
|
+
BUTTON_COLOR.DEFAULT,
|
|
255
|
+
BUTTON_COLOR.SILVER,
|
|
256
|
+
BUTTON_COLOR.WHITE,
|
|
257
|
+
BUTTON_COLOR.BLACK,
|
|
258
|
+
],
|
|
259
|
+
|
|
260
|
+
logoColors: {
|
|
261
|
+
[BUTTON_COLOR.DEFAULT]: LOGO_COLOR.DEFAULT,
|
|
262
|
+
[BUTTON_COLOR.SILVER]: LOGO_COLOR.BLACK,
|
|
263
|
+
[BUTTON_COLOR.WHITE]: LOGO_COLOR.BLACK,
|
|
264
|
+
[BUTTON_COLOR.BLACK]: LOGO_COLOR.WHITE,
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
textColors: {
|
|
268
|
+
[BUTTON_COLOR.DEFAULT]: TEXT_COLOR.WHITE,
|
|
269
|
+
[BUTTON_COLOR.BLACK]: TEXT_COLOR.WHITE,
|
|
270
|
+
[BUTTON_COLOR.SILVER]: TEXT_COLOR.BLACK,
|
|
271
|
+
[BUTTON_COLOR.WHITE]: TEXT_COLOR.BLACK,
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
secondaryColors: {
|
|
275
|
+
[DEFAULT]: BUTTON_COLOR.DEFAULT,
|
|
276
|
+
[BUTTON_COLOR.SILVER]: BUTTON_COLOR.SILVER,
|
|
277
|
+
[BUTTON_COLOR.WHITE]: BUTTON_COLOR.WHITE,
|
|
278
|
+
[BUTTON_COLOR.BLACK]: BUTTON_COLOR.BLACK,
|
|
279
|
+
},
|
|
254
280
|
};
|