@newskit-render/checkout 0.20.0 → 0.22.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/dist/{Components → cjs/Components}/Icons/Paypal/index.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Icons/Paypal/index.js +0 -0
- package/dist/cjs/Components/Icons/Paypal/index.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationRender.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationRender.js +0 -0
- package/dist/cjs/Components/Templates/AccountCreationRender.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/DateOfBirth.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/DateOfBirth.js +0 -0
- package/dist/cjs/Components/Templates/AccountCreationTemplates/DateOfBirth.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.js +0 -0
- package/dist/cjs/Components/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/Title.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/AccountCreationTemplates/Title.js +0 -0
- package/dist/cjs/Components/Templates/AccountCreationTemplates/Title.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/LayoutTemplate.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/LayoutTemplate.js +0 -0
- package/dist/cjs/Components/Templates/LayoutTemplate.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/PaymentDetailsRender.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/PaymentDetailsRender.js +0 -0
- package/dist/cjs/Components/Templates/PaymentDetailsRender.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/__tests__/mocks/index.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/__tests__/mocks/index.js +0 -0
- package/dist/cjs/Components/Templates/__tests__/mocks/index.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/index.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/index.js +0 -0
- package/dist/cjs/Components/Templates/index.js.map +1 -0
- package/dist/{Components → cjs/Components}/Templates/types.d.ts +0 -0
- package/dist/{Components → cjs/Components}/Templates/types.js +0 -0
- package/dist/cjs/Components/Templates/types.js.map +1 -0
- package/dist/{__tests__ → cjs/__tests__}/index.tests.d.ts +0 -0
- package/dist/{__tests__ → cjs/__tests__}/index.tests.js +0 -0
- package/dist/cjs/__tests__/index.tests.js.map +1 -0
- package/dist/{constants → cjs/constants}/index.d.ts +0 -0
- package/dist/{constants → cjs/constants}/index.js +0 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/{context → cjs/context}/baseContext.d.ts +0 -0
- package/dist/{context → cjs/context}/baseContext.js +0 -0
- package/dist/cjs/context/baseContext.js.map +1 -0
- package/dist/{context → cjs/context}/index.d.ts +2 -1
- package/dist/{context → cjs/context}/index.js +0 -0
- package/dist/cjs/context/index.js.map +1 -0
- package/dist/{context → cjs/context}/types.d.ts +1 -1
- package/dist/{context → cjs/context}/types.js +0 -0
- package/dist/cjs/context/types.js.map +1 -0
- package/dist/{getProviderProps.d.ts → cjs/getProviderProps.d.ts} +0 -0
- package/dist/{getProviderProps.js → cjs/getProviderProps.js} +0 -0
- package/dist/cjs/getProviderProps.js.map +1 -0
- package/dist/{helpers → cjs/helpers}/setupTests.d.ts +0 -0
- package/dist/{helpers → cjs/helpers}/setupTests.js +0 -0
- package/dist/cjs/helpers/setupTests.js.map +1 -0
- package/dist/{helpers → cjs/helpers}/testHelpers.d.ts +0 -0
- package/dist/{helpers → cjs/helpers}/testHelpers.js +0 -0
- package/dist/cjs/helpers/testHelpers.js.map +1 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- package/dist/{index.js → cjs/index.js} +0 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/{pages → cjs/pages}/AccountCreation.d.ts +0 -0
- package/dist/{pages → cjs/pages}/AccountCreation.js +0 -0
- package/dist/cjs/pages/AccountCreation.js.map +1 -0
- package/dist/{pages → cjs/pages}/PaymentDetails.d.ts +0 -0
- package/dist/{pages → cjs/pages}/PaymentDetails.js +0 -0
- package/dist/cjs/pages/PaymentDetails.js.map +1 -0
- package/dist/{pages → cjs/pages}/types.d.ts +0 -0
- package/dist/{pages → cjs/pages}/types.js +0 -0
- package/dist/cjs/pages/types.js.map +1 -0
- package/dist/{types.d.ts → cjs/types.d.ts} +0 -0
- package/dist/{types.js → cjs/types.js} +0 -0
- package/dist/{pages → cjs}/types.js.map +1 -1
- package/dist/esm/Components/Icons/Paypal/index.d.ts +4 -0
- package/dist/esm/Components/Icons/Paypal/index.js +19 -0
- package/dist/esm/Components/Icons/Paypal/index.js.map +1 -0
- package/dist/esm/Components/Templates/AccountCreationRender.d.ts +4 -0
- package/dist/esm/Components/Templates/AccountCreationRender.js +73 -0
- package/dist/esm/Components/Templates/AccountCreationRender.js.map +1 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/DateOfBirth.d.ts +3 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/DateOfBirth.js +35 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/DateOfBirth.js.map +1 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.d.ts +9 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.js +24 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.js.map +1 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/Title.d.ts +9 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/Title.js +26 -0
- package/dist/esm/Components/Templates/AccountCreationTemplates/Title.js.map +1 -0
- package/dist/esm/Components/Templates/LayoutTemplate.d.ts +6 -0
- package/dist/esm/Components/Templates/LayoutTemplate.js +70 -0
- package/dist/esm/Components/Templates/LayoutTemplate.js.map +1 -0
- package/dist/esm/Components/Templates/PaymentDetailsRender.d.ts +2 -0
- package/dist/esm/Components/Templates/PaymentDetailsRender.js +68 -0
- package/dist/esm/Components/Templates/PaymentDetailsRender.js.map +1 -0
- package/dist/esm/Components/Templates/__tests__/mocks/index.d.ts +2 -0
- package/dist/esm/Components/Templates/__tests__/mocks/index.js +66 -0
- package/dist/esm/Components/Templates/__tests__/mocks/index.js.map +1 -0
- package/dist/esm/Components/Templates/index.d.ts +1 -0
- package/dist/esm/Components/Templates/index.js +2 -0
- package/dist/esm/Components/Templates/index.js.map +1 -0
- package/dist/esm/Components/Templates/types.d.ts +10 -0
- package/dist/esm/Components/Templates/types.js +2 -0
- package/dist/esm/Components/Templates/types.js.map +1 -0
- package/dist/esm/__tests__/index.tests.d.ts +1 -0
- package/dist/esm/__tests__/index.tests.js +54 -0
- package/dist/esm/__tests__/index.tests.js.map +1 -0
- package/dist/esm/constants/index.d.ts +69 -0
- package/dist/esm/constants/index.js +70 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/context/baseContext.d.ts +2 -0
- package/dist/esm/context/baseContext.js +255 -0
- package/dist/esm/context/baseContext.js.map +1 -0
- package/dist/esm/context/index.d.ts +8 -0
- package/dist/esm/context/index.js +15 -0
- package/dist/esm/context/index.js.map +1 -0
- package/dist/esm/context/types.d.ts +82 -0
- package/dist/esm/context/types.js +2 -0
- package/dist/esm/context/types.js.map +1 -0
- package/dist/esm/getProviderProps.d.ts +9 -0
- package/dist/esm/getProviderProps.js +76 -0
- package/dist/esm/getProviderProps.js.map +1 -0
- package/dist/esm/helpers/setupTests.d.ts +1 -0
- package/dist/esm/helpers/setupTests.js +2 -0
- package/dist/esm/helpers/setupTests.js.map +1 -0
- package/dist/esm/helpers/testHelpers.d.ts +10 -0
- package/dist/esm/helpers/testHelpers.js +48 -0
- package/dist/esm/helpers/testHelpers.js.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pages/AccountCreation.d.ts +5 -0
- package/dist/esm/pages/AccountCreation.js +30 -0
- package/dist/esm/pages/AccountCreation.js.map +1 -0
- package/dist/esm/pages/PaymentDetails.d.ts +5 -0
- package/dist/esm/pages/PaymentDetails.js +170 -0
- package/dist/esm/pages/PaymentDetails.js.map +1 -0
- package/dist/esm/pages/types.d.ts +11 -0
- package/dist/esm/pages/types.js +2 -0
- package/dist/esm/pages/types.js.map +1 -0
- package/dist/esm/types.d.ts +4 -0
- package/dist/esm/types.js +2 -0
- package/dist/{context → esm}/types.js.map +1 -1
- package/package.json +10 -10
- package/dist/Components/Icons/Paypal/index.js.map +0 -1
- package/dist/Components/Templates/AccountCreationRender.js.map +0 -1
- package/dist/Components/Templates/AccountCreationTemplates/DateOfBirth.js.map +0 -1
- package/dist/Components/Templates/AccountCreationTemplates/RenderAgreementCheckboxes.js.map +0 -1
- package/dist/Components/Templates/AccountCreationTemplates/Title.js.map +0 -1
- package/dist/Components/Templates/LayoutTemplate.js.map +0 -1
- package/dist/Components/Templates/PaymentDetailsRender.js.map +0 -1
- package/dist/Components/Templates/__tests__/mocks/index.js.map +0 -1
- package/dist/Components/Templates/index.js.map +0 -1
- package/dist/Components/Templates/types.js.map +0 -1
- package/dist/__tests__/index.tests.js.map +0 -1
- package/dist/constants/index.js.map +0 -1
- package/dist/context/baseContext.js.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/getProviderProps.js.map +0 -1
- package/dist/helpers/setupTests.js.map +0 -1
- package/dist/helpers/testHelpers.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pages/AccountCreation.js.map +0 -1
- package/dist/pages/PaymentDetails.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { BASE_URL } from '../constants';
|
|
2
|
+
import { ButtonSize, IconFilledChat } from 'newskit';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
/* istanbul ignore next */
|
|
5
|
+
export var baseContext = {
|
|
6
|
+
baseUrl: BASE_URL,
|
|
7
|
+
header: {
|
|
8
|
+
overlineOverrides: {
|
|
9
|
+
typographyPreset: {
|
|
10
|
+
xs: 'utitityLabel020',
|
|
11
|
+
sm: 'utitityLabel030',
|
|
12
|
+
},
|
|
13
|
+
stylePreset: 'inkBrand010',
|
|
14
|
+
spaceStack: 'space040',
|
|
15
|
+
},
|
|
16
|
+
title: '',
|
|
17
|
+
titleOverrides: {
|
|
18
|
+
typographyPreset: { xs: 'utilityHeading040', sm: 'utilityHeading050' },
|
|
19
|
+
stylePreset: 'inkContrast',
|
|
20
|
+
spaceStack: {
|
|
21
|
+
xs: 'space040',
|
|
22
|
+
sm: 'space050',
|
|
23
|
+
},
|
|
24
|
+
as: 'h1',
|
|
25
|
+
},
|
|
26
|
+
description: '',
|
|
27
|
+
descriptionOverrides: {
|
|
28
|
+
typographyPreset: { xs: 'utilityBody020', sm: 'utilityBody030' },
|
|
29
|
+
stylePreset: 'inkBase',
|
|
30
|
+
spaceStack: {
|
|
31
|
+
xs: 'space050',
|
|
32
|
+
sm: 'space060',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
spaceStack: { xs: 'space050', sm: 'space060', md: 'space080' },
|
|
36
|
+
showDivider: false,
|
|
37
|
+
},
|
|
38
|
+
navigationPrimary: {
|
|
39
|
+
logoSrc: '/MyAccount/primary-navigation-logo-white.svg',
|
|
40
|
+
},
|
|
41
|
+
paymentDetailsPage: {
|
|
42
|
+
subscriptionDetails: {
|
|
43
|
+
bannerOverrides: {
|
|
44
|
+
stylePreset: { xs: 'subscribtionDetails' },
|
|
45
|
+
spaceInset: { xs: 'spaceInset000' },
|
|
46
|
+
maxWidth: '100%',
|
|
47
|
+
minHeight: 'sizing000',
|
|
48
|
+
content: {
|
|
49
|
+
title: {
|
|
50
|
+
stylePreset: 'inkBase',
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
typographyPreset: 'utilityMeta010',
|
|
54
|
+
stylePreset: 'inkSubtle',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
containerOverrides: {
|
|
59
|
+
stylePreset: { xs: 'headerSubscriptionContainer' },
|
|
60
|
+
spaceStack: { xs: 'space040' },
|
|
61
|
+
},
|
|
62
|
+
margin: {
|
|
63
|
+
xsMargin: 'space050',
|
|
64
|
+
smMargin: 'space060',
|
|
65
|
+
mdMargin: 'space000',
|
|
66
|
+
},
|
|
67
|
+
gutter: {
|
|
68
|
+
xsColumnGutter: 'space020',
|
|
69
|
+
smColumnGutter: 'space040',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
corePackageContent: {
|
|
73
|
+
titleBar: {
|
|
74
|
+
text: '',
|
|
75
|
+
spaceStack: 'space040',
|
|
76
|
+
overrides: {
|
|
77
|
+
heading: {
|
|
78
|
+
typographyPreset: {
|
|
79
|
+
xs: 'utilityHeading010',
|
|
80
|
+
md: 'utilityHeading020',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
spaceInset: 'spaceInset000',
|
|
84
|
+
},
|
|
85
|
+
linkOverriders: {
|
|
86
|
+
iconSize: 'iconSize010',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
benifitList: {
|
|
90
|
+
spaceStack: 'space020',
|
|
91
|
+
markerAlign: 'start',
|
|
92
|
+
overrides: {
|
|
93
|
+
spaceStack: { xs: 'space040' },
|
|
94
|
+
content: {
|
|
95
|
+
stylePreset: 'inkBase',
|
|
96
|
+
typographyPreset: 'utilityBody020',
|
|
97
|
+
},
|
|
98
|
+
marker: {
|
|
99
|
+
size: 'iconSize005',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
divider: {
|
|
104
|
+
spaceStack: 'space050',
|
|
105
|
+
},
|
|
106
|
+
promo: '',
|
|
107
|
+
promoOverrides: {
|
|
108
|
+
spaceStack: 'space020',
|
|
109
|
+
typographyPreset: 'utilityBody010',
|
|
110
|
+
stylePreset: 'inkPositive',
|
|
111
|
+
},
|
|
112
|
+
paymentKey: '',
|
|
113
|
+
paymentValue: '',
|
|
114
|
+
paymentOverrides: {
|
|
115
|
+
spaceStack: 'space040',
|
|
116
|
+
typographyPreset: {
|
|
117
|
+
xs: 'utilityHeading020',
|
|
118
|
+
lg: 'utilityHeading040',
|
|
119
|
+
},
|
|
120
|
+
stylePreset: 'iinkContrast',
|
|
121
|
+
},
|
|
122
|
+
description: '',
|
|
123
|
+
descriptionOverrides: {
|
|
124
|
+
spaceStack: 'space060',
|
|
125
|
+
typographyPreset: 'utilityMeta010',
|
|
126
|
+
stylePreset: 'inkSubtle',
|
|
127
|
+
},
|
|
128
|
+
billingDetails: '',
|
|
129
|
+
billingDetailsOverrides: {
|
|
130
|
+
spaceStack: 'space040',
|
|
131
|
+
typographyPreset: 'utilityMeta010',
|
|
132
|
+
stylePreset: 'inkSubtle',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
subscriptionDrawer: {
|
|
136
|
+
open: false,
|
|
137
|
+
closePosition: 'left',
|
|
138
|
+
size: '80%',
|
|
139
|
+
overrides: {
|
|
140
|
+
header: {
|
|
141
|
+
spaceInset: 'spaceInset000',
|
|
142
|
+
},
|
|
143
|
+
content: {
|
|
144
|
+
spaceInset: 'spaceInsetStretch050',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
titleBar: {
|
|
148
|
+
text: '',
|
|
149
|
+
spaceStack: 'space040',
|
|
150
|
+
overrides: {
|
|
151
|
+
heading: {
|
|
152
|
+
typographyPreset: {
|
|
153
|
+
xs: 'utilityHeading010',
|
|
154
|
+
md: 'utilityHeading020',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
spaceInset: 'spaceInset000',
|
|
158
|
+
},
|
|
159
|
+
linkOverriders: {
|
|
160
|
+
iconSize: 'iconSize010',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
benifitList: {
|
|
164
|
+
spaceStack: 'space020',
|
|
165
|
+
markerAlign: 'start',
|
|
166
|
+
overrides: {
|
|
167
|
+
spaceStack: { xs: 'space040' },
|
|
168
|
+
content: {
|
|
169
|
+
stylePreset: 'inkBase',
|
|
170
|
+
typographyPreset: 'utilityBody020',
|
|
171
|
+
},
|
|
172
|
+
marker: {
|
|
173
|
+
size: 'iconSize005',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
divider: {
|
|
178
|
+
spaceStack: 'space050',
|
|
179
|
+
},
|
|
180
|
+
promo: '',
|
|
181
|
+
promoOverrides: {
|
|
182
|
+
spaceStack: 'space020',
|
|
183
|
+
typographyPreset: 'utilityBody010',
|
|
184
|
+
stylePreset: 'inkPositive',
|
|
185
|
+
},
|
|
186
|
+
paymentKey: '',
|
|
187
|
+
paymentValue: '',
|
|
188
|
+
paymentOverrides: {
|
|
189
|
+
spaceStack: 'space040',
|
|
190
|
+
typographyPreset: {
|
|
191
|
+
xs: 'utilityHeading020',
|
|
192
|
+
lg: 'utilityHeading040',
|
|
193
|
+
},
|
|
194
|
+
stylePreset: 'iinkContrast',
|
|
195
|
+
},
|
|
196
|
+
description: '',
|
|
197
|
+
descriptionOverrides: {
|
|
198
|
+
spaceStack: 'space060',
|
|
199
|
+
typographyPreset: 'utilityMeta010',
|
|
200
|
+
stylePreset: 'inkSubtle',
|
|
201
|
+
},
|
|
202
|
+
billingDetails: '',
|
|
203
|
+
billingDetailsOverrides: {
|
|
204
|
+
spaceStack: 'space040',
|
|
205
|
+
typographyPreset: 'utilityMeta010',
|
|
206
|
+
stylePreset: 'inkSubtle',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
footer: {
|
|
211
|
+
helpChat: true,
|
|
212
|
+
menuItemArray: [
|
|
213
|
+
{ text: 'About us', href: '/about-us', id: 1 },
|
|
214
|
+
{
|
|
215
|
+
text: 'Privacy & cookie policy',
|
|
216
|
+
href: 'http://www.newsprivacy.co.uk/',
|
|
217
|
+
id: 3,
|
|
218
|
+
},
|
|
219
|
+
{ text: 'Terms & conditions', href: '/terms-and-conditions', id: 4 },
|
|
220
|
+
],
|
|
221
|
+
legalText: "\u00A9 NewsKit Limited " + new Date().getFullYear() + ".\n Registered in England No. 000000. Registered office: 1 London Bridge Street, SE1 9GF.",
|
|
222
|
+
},
|
|
223
|
+
footerOverrides: {
|
|
224
|
+
ariaLabel: 'Footer Menu',
|
|
225
|
+
menuItemOverrides: {
|
|
226
|
+
stylePreset: 'baseInteractivePrimary030',
|
|
227
|
+
typographyPreset: 'utilityButton020',
|
|
228
|
+
},
|
|
229
|
+
menuOverrides: {
|
|
230
|
+
spaceStack: 'space060',
|
|
231
|
+
backgroundColor: 'interface010',
|
|
232
|
+
borderColor: 'interface050',
|
|
233
|
+
padding: { md: 'sizing090', xs: 'sizing040' },
|
|
234
|
+
},
|
|
235
|
+
legalTextOverrides: {
|
|
236
|
+
spaceStack: 'space050',
|
|
237
|
+
stylePreset: 'inkSublte',
|
|
238
|
+
typographyPreset: 'utilityMeta010',
|
|
239
|
+
padding: { md: 'sizing100', xs: 'sizing060' },
|
|
240
|
+
},
|
|
241
|
+
chatHelpOverrides: {
|
|
242
|
+
icon: (React.createElement(IconFilledChat, { overrides: {
|
|
243
|
+
size: 'iconSize030',
|
|
244
|
+
stylePreset: 'inkContrast',
|
|
245
|
+
} })),
|
|
246
|
+
buttonOverrides: {
|
|
247
|
+
size: ButtonSize.Small,
|
|
248
|
+
stylePreset: 'buttonOutlinedSecondary',
|
|
249
|
+
},
|
|
250
|
+
helpSubheadline: 'Get a quick response from our team members',
|
|
251
|
+
helpHeadline: 'Need help?',
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=baseContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseContext.js","sourceRoot":"","sources":["../../../src/context/baseContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,0BAA0B;AAC1B,MAAM,CAAC,IAAM,WAAW,GAAmB;IACzC,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,gBAAgB,EAAE;gBAChB,EAAE,EAAE,iBAAiB;gBACrB,EAAE,EAAE,iBAAiB;aACtB;YACD,WAAW,EAAE,aAAa;YAC1B,UAAU,EAAE,UAAU;SACvB;QACD,KAAK,EAAE,EAAE;QACT,cAAc,EAAE;YACd,gBAAgB,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,mBAAmB,EAAE;YACtE,WAAW,EAAE,aAAa;YAC1B,UAAU,EAAE;gBACV,EAAE,EAAE,UAAU;gBACd,EAAE,EAAE,UAAU;aACf;YACD,EAAE,EAAE,IAAI;SACT;QACD,WAAW,EAAE,EAAE;QACf,oBAAoB,EAAE;YACpB,gBAAgB,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,EAAE;YAChE,WAAW,EAAE,SAAS;YACtB,UAAU,EAAE;gBACV,EAAE,EAAE,UAAU;gBACd,EAAE,EAAE,UAAU;aACf;SACF;QACD,UAAU,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE;QAC9D,WAAW,EAAE,KAAK;KACnB;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,8CAA8C;KACxD;IACD,kBAAkB,EAAE;QAClB,mBAAmB,EAAE;YACnB,eAAe,EAAE;gBACf,WAAW,EAAE,EAAE,EAAE,EAAE,qBAAqB,EAAE;gBAC1C,UAAU,EAAE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,kBAAkB;SACrC;QACD,aAAa,EAAE;YACb,UAAU,EAAE,UAAU;YACtB,eAAe,EAAE,cAAc;YAC/B,WAAW,EAAE,cAAc;YAC3B,OAAO,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE;SAC9C;QACD,kBAAkB,EAAE;YAClB,UAAU,EAAE,UAAU;YACtB,WAAW,EAAE,WAAW;YACxB,gBAAgB,EAAE,gBAAgB;YAClC,OAAO,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE;SAC9C;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,CACJ,oBAAC,cAAc,IACb,SAAS,EAAE;oBACT,IAAI,EAAE,aAAa;oBACnB,WAAW,EAAE,aAAa;iBAC3B,GACD,CACH;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,UAAU,CAAC,KAAK;gBACtB,WAAW,EAAE,yBAAyB;aACvC;YACD,eAAe,EAAE,4CAA4C;YAC7D,YAAY,EAAE,YAAY;SAC3B;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContextOptions, ContextProviderProps } from './types';
|
|
3
|
+
import { baseContext } from './baseContext';
|
|
4
|
+
export declare const CheckoutContextProvider: React.FC<ContextProviderProps>;
|
|
5
|
+
export declare const CheckoutContextConsumer: React.Consumer<ContextOptions>;
|
|
6
|
+
export declare const useCheckoutContext: () => ContextOptions;
|
|
7
|
+
export { baseContext };
|
|
8
|
+
export type { ContextOptions };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import merge from 'lodash.merge';
|
|
3
|
+
import { baseContext } from './baseContext';
|
|
4
|
+
var CheckoutContext = createContext({});
|
|
5
|
+
export var CheckoutContextProvider = function (_a) {
|
|
6
|
+
var context = _a.context, children = _a.children;
|
|
7
|
+
var c = merge({}, baseContext, context);
|
|
8
|
+
return (React.createElement(CheckoutContext.Provider, { value: c }, children));
|
|
9
|
+
};
|
|
10
|
+
export var CheckoutContextConsumer = CheckoutContext.Consumer;
|
|
11
|
+
export var useCheckoutContext = function () {
|
|
12
|
+
return useContext(CheckoutContext);
|
|
13
|
+
};
|
|
14
|
+
export { baseContext };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,IAAM,eAAe,GAAG,aAAa,CAAiB,EAAE,CAAC,CAAA;AAEzD,MAAM,CAAC,IAAM,uBAAuB,GAAmC,UAAC,EAGvE;QAFC,OAAO,aAAA,EACP,QAAQ,cAAA;IAER,IAAM,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;IACzC,OAAO,CACL,oBAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,IAAG,QAAQ,CAA4B,CAC1E,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,uBAAuB,GAAG,eAAe,CAAC,QAAQ,CAAA;AAE/D,MAAM,CAAC,IAAM,kBAAkB,GAAG;IAChC,OAAA,UAAU,CAAC,eAAe,CAAC;AAA3B,CAA2B,CAAA;AAE7B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { HeaderProps, NavigationPrimaryProps, SubscriptionDetailsProps, CorePackageContentProps, SubscriptionDrawerProps, ButtonGroupProps, FooterContext, FooterContextOverrides } from '@newskit-render/shared-components';
|
|
3
|
+
import { MQ, InlineMessageProps, TabProps } from 'newskit';
|
|
4
|
+
interface InfoPanel extends InlineMessageProps {
|
|
5
|
+
spaceStack?: MQ<string>;
|
|
6
|
+
}
|
|
7
|
+
interface SubscriptionMessage {
|
|
8
|
+
text: string | React.ReactElement;
|
|
9
|
+
spaceStack?: MQ<string>;
|
|
10
|
+
}
|
|
11
|
+
interface PaymentDetailsPage {
|
|
12
|
+
infoPanel?: InfoPanel;
|
|
13
|
+
subscriptionDetails?: SubscriptionDetailsProps;
|
|
14
|
+
corePackageContent?: CorePackageContentProps;
|
|
15
|
+
subscriptionDrawer?: Partial<SubscriptionDrawerProps>;
|
|
16
|
+
subscriptionDrawerControl?: () => void;
|
|
17
|
+
subscriptionDrawerState?: boolean;
|
|
18
|
+
subscriptionMessage?: SubscriptionMessage;
|
|
19
|
+
subscriptionTabs?: {
|
|
20
|
+
tab1: Omit<TabProps, 'children'>;
|
|
21
|
+
tab2: Omit<TabProps, 'children'>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare type ClosePosition = 'left' | 'right' | 'none';
|
|
25
|
+
export interface AccountCreationPageProps {
|
|
26
|
+
validation?: Record<string, any>;
|
|
27
|
+
modalOverrides: {
|
|
28
|
+
closePosition: ClosePosition;
|
|
29
|
+
open: boolean;
|
|
30
|
+
onDismiss?: () => void;
|
|
31
|
+
overrides: {
|
|
32
|
+
content: {
|
|
33
|
+
spaceInset?: MQ<string>;
|
|
34
|
+
};
|
|
35
|
+
panel: {
|
|
36
|
+
width: MQ<string>;
|
|
37
|
+
maxHeight: MQ<string>;
|
|
38
|
+
height: MQ<string>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
introduction: {
|
|
42
|
+
title: string;
|
|
43
|
+
titleOverrides: {
|
|
44
|
+
typographyPreset: MQ<string>;
|
|
45
|
+
spaceStack: MQ<string>;
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
descriptionOverrides: {
|
|
49
|
+
typographyPreset: string;
|
|
50
|
+
removeLastspaceStack: boolean;
|
|
51
|
+
spaceStack: MQ<string>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
userData: {
|
|
56
|
+
titleOptions: string[];
|
|
57
|
+
};
|
|
58
|
+
buttonGroupProps: Partial<ButtonGroupProps>;
|
|
59
|
+
}
|
|
60
|
+
export interface ContextOptions {
|
|
61
|
+
baseUrl?: string;
|
|
62
|
+
env?: Record<string, unknown>;
|
|
63
|
+
data?: Record<string, unknown>;
|
|
64
|
+
siteTitle?: string;
|
|
65
|
+
siteDescription?: string;
|
|
66
|
+
url?: string;
|
|
67
|
+
siteHost?: string;
|
|
68
|
+
fbType?: string;
|
|
69
|
+
fbImageUrl?: string;
|
|
70
|
+
navigationPrimary?: Partial<NavigationPrimaryProps>;
|
|
71
|
+
header?: HeaderProps;
|
|
72
|
+
paymentDetailsPage?: PaymentDetailsPage;
|
|
73
|
+
buttonGroupProps?: Partial<ButtonGroupProps>;
|
|
74
|
+
footer?: FooterContext;
|
|
75
|
+
footerOverrides?: FooterContextOverrides;
|
|
76
|
+
accountCreationPage?: AccountCreationPageProps;
|
|
77
|
+
}
|
|
78
|
+
export interface ContextProviderProps {
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
context: ContextOptions;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GetServerSidePropsResult, GetServerSidePropsContext } from 'next';
|
|
2
|
+
declare type ServerSidePropsContext = GetServerSidePropsContext & {
|
|
3
|
+
provider: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const getProviderProps: (context: ServerSidePropsContext) => Promise<GetServerSidePropsResult<{
|
|
6
|
+
field: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export var getProviderProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
+
var provider, providerPropsMapper, providerProps;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
provider = context.provider;
|
|
52
|
+
providerPropsMapper = {
|
|
53
|
+
accountCreation: function () {
|
|
54
|
+
// TODO - replace with MAIN data
|
|
55
|
+
var data = {
|
|
56
|
+
fieldOne: 'one',
|
|
57
|
+
fieldTwo: 'two',
|
|
58
|
+
};
|
|
59
|
+
return { data: data };
|
|
60
|
+
},
|
|
61
|
+
paymentDetails: function () {
|
|
62
|
+
// TODO - replace with MAIN data
|
|
63
|
+
var data = {
|
|
64
|
+
fieldThree: 'three',
|
|
65
|
+
fieldFour: 'four',
|
|
66
|
+
};
|
|
67
|
+
return { data: data };
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
providerProps = providerPropsMapper[provider]();
|
|
71
|
+
return [2 /*return*/, {
|
|
72
|
+
props: __assign(__assign({}, providerProps), { url: context.req.headers.host || '' }),
|
|
73
|
+
}];
|
|
74
|
+
});
|
|
75
|
+
}); };
|
|
76
|
+
//# sourceMappingURL=getProviderProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProviderProps.js","sourceRoot":"","sources":["../../src/getProviderProps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAC9B,OAA+B;;;QAEvB,QAAQ,GAAK,OAAO,SAAZ,CAAY;QAEtB,mBAAmB,GAAG;YAC1B,eAAe,EAAE;gBACf,gCAAgC;gBAChC,IAAM,IAAI,GAAG;oBACX,QAAQ,EAAE,KAAK;oBACf,QAAQ,EAAE,KAAK;iBAChB,CAAA;gBACD,OAAO,EAAE,IAAI,MAAA,EAAE,CAAA;YACjB,CAAC;YACD,cAAc,EAAE;gBACd,gCAAgC;gBAChC,IAAM,IAAI,GAAG;oBACX,UAAU,EAAE,OAAO;oBACnB,SAAS,EAAE,MAAM;iBAClB,CAAA;gBACD,OAAO,EAAE,IAAI,MAAA,EAAE,CAAA;YACjB,CAAC;SACF,CAAA;QAEK,aAAa,GAAG,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAAA;QAErD,sBAAO;gBACL,KAAK,wBAAO,aAAa,KAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,GAAE;aACjE,EAAA;;KACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.js","sourceRoot":"","sources":["../../../src/helpers/setupTests.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RenderOptions } from '@testing-library/react';
|
|
3
|
+
import { UncompiledTheme } from 'newskit';
|
|
4
|
+
import { ContextOptions } from '../context';
|
|
5
|
+
export declare const renderWithThemeTsl: <T extends {}>(Component: React.ComponentType<T>, props?: (T & {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}) | undefined, theme?: UncompiledTheme, options?: Omit<RenderOptions<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "wrapper"> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>;
|
|
8
|
+
export declare const renderWithContextTsl: <T extends {}>(Component: React.ComponentType<T>, props?: (T & {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}) | undefined, context?: ContextOptions, options?: Omit<RenderOptions<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "wrapper"> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/ban-types */
|
|
13
|
+
/** Added as described in Jest docs: https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
|
|
14
|
+
* Needed because at least one component uses <MediaQueryProvider> from newskit, which uses window.matchmedia
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
17
|
+
writable: true,
|
|
18
|
+
value: jest.fn().mockImplementation(function (query) { return ({
|
|
19
|
+
matches: false,
|
|
20
|
+
media: query,
|
|
21
|
+
onchange: null,
|
|
22
|
+
addListener: jest.fn(),
|
|
23
|
+
removeListener: jest.fn(),
|
|
24
|
+
addEventListener: jest.fn(),
|
|
25
|
+
removeEventListener: jest.fn(),
|
|
26
|
+
dispatchEvent: jest.fn(),
|
|
27
|
+
}); }),
|
|
28
|
+
});
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import { render as renderTsl } from '@testing-library/react';
|
|
31
|
+
import { ThemeProvider, newskitLightTheme } from 'newskit';
|
|
32
|
+
import { CheckoutContextProvider } from '../context';
|
|
33
|
+
export var renderWithThemeTsl = function (Component, props, theme, options) {
|
|
34
|
+
if (theme === void 0) { theme = newskitLightTheme; }
|
|
35
|
+
return renderTsl(React.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
36
|
+
var children = _a.children;
|
|
37
|
+
return (React.createElement(ThemeProvider, { theme: theme }, children));
|
|
38
|
+
} }));
|
|
39
|
+
};
|
|
40
|
+
export var renderWithContextTsl = function (Component, props, context, options) {
|
|
41
|
+
if (context === void 0) { context = {}; }
|
|
42
|
+
return renderTsl(React.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
43
|
+
var children = _a.children;
|
|
44
|
+
return (React.createElement(CheckoutContextProvider, { context: context },
|
|
45
|
+
React.createElement(ThemeProvider, { theme: newskitLightTheme }, children)));
|
|
46
|
+
} }));
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=testHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/helpers/testHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,oGAAoG;AACpG;;GAEG;AACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;IAC1C,QAAQ,EAAE,IAAI;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AV,QAAQ,cAAA;YAAO,OAAA,CACzB,oBAAC,uBAAuB,IAAC,OAAO,EAAE,OAAO;gBACvC,oBAAC,aAAa,IAAC,KAAK,EAAE,iBAAiB,IAAG,QAAQ,CAAiB,CAC3C,CAC3B;QAJ0B,CAI1B,IACD;AAPF,CAOE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { LayoutTemplate } from '../Components/Templates';
|
|
14
|
+
import { AccountCreationRender } from '../Components/Templates/AccountCreationRender';
|
|
15
|
+
var title = 'Create an account';
|
|
16
|
+
export var acountCreationContext = {
|
|
17
|
+
siteTitle: title,
|
|
18
|
+
header: {
|
|
19
|
+
overline: 'Step 1 of 2',
|
|
20
|
+
title: title,
|
|
21
|
+
description: 'Lets get you set up with an account first, then we can finalise your subscription.',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export var AccountCreation = function (_a) {
|
|
25
|
+
var customTheme = _a.customTheme, setTheme = _a.setTheme, context = _a.context, url = _a.url, data = _a.data, _b = _a.validation, validation = _b === void 0 ? {} : _b;
|
|
26
|
+
var enhancedContext = __assign(__assign({}, (context || acountCreationContext)), { url: url, data: data });
|
|
27
|
+
return (React.createElement(LayoutTemplate, { context: enhancedContext, customTheme: customTheme, setTheme: setTheme },
|
|
28
|
+
React.createElement(AccountCreationRender, { validation: validation })));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=AccountCreation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountCreation.js","sourceRoot":"","sources":["../../../src/pages/AccountCreation.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAGxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AAErF,IAAM,KAAK,GAAG,mBAAmB,CAAA;AAEjC,MAAM,CAAC,IAAM,qBAAqB,GAAmB;IACnD,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE;QACN,QAAQ,EAAE,aAAa;QACvB,KAAK,OAAA;QACL,WAAW,EACT,oFAAoF;KACvF;CACF,CAAA;AAED,MAAM,CAAC,IAAM,eAAe,GAA4B,UAAC,EAOxD;QANC,WAAW,iBAAA,EACX,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,GAAG,SAAA,EACH,IAAI,UAAA,EACJ,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA;IAEf,IAAM,eAAe,yBAChB,CAAC,OAAO,IAAI,qBAAqB,CAAC,KACrC,GAAG,KAAA,EACH,IAAI,MAAA,GACL,CAAA;IACD,OAAO,CACL,oBAAC,cAAc,IACb,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ;QAElB,oBAAC,qBAAqB,IAAC,UAAU,EAAE,UAAU,GAAI,CAClC,CAClB,CAAA;AACH,CAAC,CAAA"}
|