@financial-times/n-conversion-forms 27.7.2 → 28.0.1

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 (118) hide show
  1. package/.eslintignore +1 -0
  2. package/build-state/npm-shrinkwrap.json +1864 -1326
  3. package/components/__snapshots__/payment-type.spec.js.snap +0 -2
  4. package/components/accept-terms.jsx +18 -16
  5. package/components/app-banner.jsx +1 -1
  6. package/components/b2c-partnership-confirmation.jsx +1 -1
  7. package/components/billing-city.jsx +1 -1
  8. package/components/billing-country.jsx +1 -1
  9. package/components/billing-postcode.jsx +1 -1
  10. package/components/company-name.jsx +1 -1
  11. package/components/confirmation.jsx +5 -4
  12. package/components/continue-reading.jsx +1 -1
  13. package/components/continue-reading.stories.js +1 -1
  14. package/components/country.jsx +1 -1
  15. package/components/customer-care.jsx +1 -1
  16. package/components/debug.jsx +1 -1
  17. package/components/decision-maker.jsx +1 -1
  18. package/components/decision-maker.spec.js +1 -1
  19. package/components/deferred-billing-terms.jsx +92 -76
  20. package/components/deferred-billing-terms.spec.js +5 -1
  21. package/components/deferred-billing-terms.stories.js +3 -3
  22. package/components/delivery-address-type.jsx +4 -4
  23. package/components/delivery-address.jsx +1 -1
  24. package/components/delivery-city.jsx +9 -5
  25. package/components/delivery-county.jsx +1 -1
  26. package/components/delivery-instructions.jsx +30 -21
  27. package/components/delivery-option.jsx +5 -2
  28. package/components/delivery-po-box.jsx +1 -1
  29. package/components/delivery-postcode.jsx +32 -28
  30. package/components/delivery-security-instructions.jsx +1 -1
  31. package/components/delivery-start-date.jsx +1 -1
  32. package/components/education-job-title.jsx +1 -1
  33. package/components/email.jsx +1 -1
  34. package/components/error-page.jsx +1 -1
  35. package/components/fieldset.jsx +1 -1
  36. package/components/first-name.jsx +1 -1
  37. package/components/form.jsx +1 -1
  38. package/components/google-sign-in.jsx +1 -1
  39. package/components/graduation-date.jsx +1 -1
  40. package/components/industry.jsx +1 -1
  41. package/components/job-title.jsx +1 -1
  42. package/components/last-name.jsx +1 -1
  43. package/components/licence-confirmation.jsx +10 -8
  44. package/components/licence-header.jsx +3 -3
  45. package/components/licence-sign-in.jsx +2 -2
  46. package/components/licence-title.jsx +2 -2
  47. package/components/lite-sub-confirmation.jsx +1 -1
  48. package/components/loader.jsx +1 -1
  49. package/components/message.jsx +1 -1
  50. package/components/organisation.jsx +1 -1
  51. package/components/package-change.jsx +1 -1
  52. package/components/password.jsx +1 -1
  53. package/components/payment-term.jsx +52 -43
  54. package/components/payment-term.spec.js +15 -9
  55. package/components/payment-term.stories.js +63 -63
  56. package/components/payment-type.jsx +4 -4
  57. package/components/personal-title.jsx +1 -1
  58. package/components/phone.jsx +1 -1
  59. package/components/position.jsx +1 -1
  60. package/components/progress-indicator.jsx +3 -3
  61. package/components/province.jsx +1 -1
  62. package/components/registration-confirmation.jsx +1 -1
  63. package/components/responsibility.jsx +1 -1
  64. package/components/section.jsx +1 -1
  65. package/components/state.jsx +1 -1
  66. package/components/submit.jsx +1 -1
  67. package/components/text-input.jsx +1 -1
  68. package/components/trial-banner.jsx +1 -1
  69. package/dist/deferred-billing-terms.js +2 -3
  70. package/dist/payment-term.js +1 -1
  71. package/dist/payment-type.js +2 -2
  72. package/helpers/index.js +11 -8
  73. package/helpers/ncf-countries.spec.js +1 -1
  74. package/helpers/supportedCountries.js +12 -5
  75. package/helpers/supportedPostcodeExamples.js +5 -5
  76. package/helpers/supportedPostcodeValidators.js +5 -5
  77. package/helpers/supportedPostcodeValidators.spec.js +30 -10
  78. package/helpers/utilities.js +4 -4
  79. package/jest.config.js +1 -5
  80. package/package.json +14 -17
  81. package/test-jest/helpers/expect-to-render-correctly.js +1 -1
  82. package/utils/app-banner.js +1 -1
  83. package/utils/apple-pay.js +15 -15
  84. package/utils/billing-city.js +1 -1
  85. package/utils/billing-country.js +3 -3
  86. package/utils/billing-postcode.js +1 -1
  87. package/utils/company-name.js +1 -1
  88. package/utils/countries.js +2 -2
  89. package/utils/country.js +3 -3
  90. package/utils/delivery-address-type.js +3 -3
  91. package/utils/delivery-address-type.spec.js +6 -2
  92. package/utils/delivery-address.js +1 -1
  93. package/utils/delivery-instructions.js +1 -1
  94. package/utils/delivery-option-messages.js +11 -11
  95. package/utils/delivery-option-messages.spec.js +4 -13
  96. package/utils/delivery-option.js +5 -5
  97. package/utils/delivery-po-box.js +1 -1
  98. package/utils/delivery-postcode.js +1 -1
  99. package/utils/delivery-start-date.js +4 -4
  100. package/utils/delivery-start-date.spec.js +3 -2
  101. package/utils/email.js +4 -4
  102. package/utils/email.spec.js +2 -1
  103. package/utils/event-notifier.js +1 -1
  104. package/utils/form-element.js +8 -8
  105. package/utils/loader.js +10 -10
  106. package/utils/password.js +2 -2
  107. package/utils/payment-term.js +16 -15
  108. package/utils/payment-type.js +14 -14
  109. package/utils/postcode.js +3 -3
  110. package/utils/postcode.spec.js +21 -12
  111. package/utils/province.js +1 -1
  112. package/utils/salesforce.js +2 -2
  113. package/utils/state.js +1 -1
  114. package/utils/submit.js +5 -5
  115. package/utils/tracking.js +7 -7
  116. package/utils/validation.js +18 -11
  117. package/utils/zuora-error-map.js +5 -5
  118. package/utils/zuora.js +17 -12
@@ -1,12 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- import {
5
- Period,
6
- Monthly,
7
- } from '@financial-times/n-pricing';
4
+ import { Period, Monthly } from '@financial-times/n-pricing';
8
5
 
9
- export function PaymentTerm ({
6
+ export function PaymentTerm({
10
7
  fieldId = 'paymentTermField',
11
8
  inputName = 'paymentTerm',
12
9
  isPrintOrBundle = false,
@@ -18,7 +15,6 @@ export function PaymentTerm ({
18
15
  largePrice = false,
19
16
  optionsInARow = false,
20
17
  }) {
21
-
22
18
  /**
23
19
  * Compute monthly price for given term name
24
20
  * @param {number} amount price in number format
@@ -39,11 +35,10 @@ export function PaymentTerm ({
39
35
  * @returns {string}
40
36
  */
41
37
  const getTimeFromPeriod = (period) => {
42
- const freq = period.substring(period.length - 1) === 'Y' ? 'years' : 'months';
38
+ const freq =
39
+ period.substring(period.length - 1) === 'Y' ? 'years' : 'months';
43
40
  const amount = period.substring(1, period.length - 1);
44
- return (
45
- period ? `${amount} ${freq}` : ''
46
- );
41
+ return period ? `${amount} ${freq}` : '';
47
42
  };
48
43
 
49
44
  const isValidPeriod = (period) => {
@@ -144,7 +139,8 @@ export function PaymentTerm ({
144
139
  trialPrice: (trialPrice, trialPeriod) => (
145
140
  <React.Fragment>
146
141
  Unless you cancel during your trial you will be billed{' '}
147
- <span className="ncf__payment-term__price">{trialPrice}</span> per {trialPeriod}
142
+ <span className="ncf__payment-term__price">{trialPrice}</span> per{' '}
143
+ {trialPeriod}
148
144
  after the trial period.
149
145
  </React.Fragment>
150
146
  ),
@@ -152,18 +148,19 @@ export function PaymentTerm ({
152
148
  Boolean(monthlyPrice) && (
153
149
  <span className="ncf__payment-term__equivalent-price">
154
150
  That’s equivalent to{' '}
155
- <span className="ncf__payment-term__monthly-price">{monthlyPrice}</span>{' '}
151
+ <span className="ncf__payment-term__monthly-price">
152
+ {monthlyPrice}
153
+ </span>{' '}
156
154
  per month
157
155
  </span>
158
156
  ),
159
- renewsText: (renewalPeriod) => (
157
+ renewsText: (renewalPeriod) =>
160
158
  Boolean(renewalPeriod) && (
161
159
  <p className="ncf__payment-term__renews-text">
162
160
  Renews every {renewalPeriod} unless cancelled
163
161
  </p>
164
- )
165
- ),
166
- }
162
+ ),
163
+ },
167
164
  };
168
165
  const createPaymentTerm = (option) => {
169
166
  const className = classNames([
@@ -186,7 +183,9 @@ export function PaymentTerm ({
186
183
  return (
187
184
  option.discount && (
188
185
  <span className="ncf__payment-term__discount">
189
- {option.bestOffer ? 'Best offer' : `Save ${option.discount} off RRP`}
186
+ {option.bestOffer
187
+ ? 'Best offer'
188
+ : `Save ${option.discount} off RRP`}
190
189
  </span>
191
190
  )
192
191
  );
@@ -194,7 +193,9 @@ export function PaymentTerm ({
194
193
 
195
194
  const createB2cDiscountCopy = () => {
196
195
  return (
197
- option.name === 'annual' && option.b2cPartnership && option.b2cDiscountCopy && (
196
+ option.name === 'annual' &&
197
+ option.b2cPartnership &&
198
+ option.b2cDiscountCopy && (
198
199
  <span className="ncf__payment-term__discount">
199
200
  {option.b2cDiscountCopy}
200
201
  </span>
@@ -222,40 +223,46 @@ export function PaymentTerm ({
222
223
  {/* Remove this discount text temporarily in favour of monthly price */}
223
224
  {/* <br />Save up to 25% when you pay annually */}
224
225
  </div>
226
+ ) : // this should cover the cases different than annual, quarterly and monthly
227
+ // for those containing period on option.value, render custom template, for the rest keep legacy render
228
+ isValidPeriod(option.value) ? (
229
+ <div className="ncf__payment-term__description">
230
+ {nameMap['custom'].price(option.price)}
231
+ {nameMap['custom'].monthlyPrice(
232
+ option.monthlyPrice && option.monthlyPrice !== '0'
233
+ ? Number(option.monthlyPrice)
234
+ : getMontlyPriceFromPeriod(
235
+ option.amount,
236
+ option.currency,
237
+ option.value
238
+ )
239
+ )}
240
+ {nameMap['custom'].renewsText(getTimeFromPeriod(option.value))}
241
+ </div>
225
242
  ) : (
226
- // this should cover the cases different than annual, quarterly and monthly
227
- // for those containing period on option.value, render custom template, for the rest keep legacy render
228
- isValidPeriod(option.value) ?
229
- <div className="ncf__payment-term__description">
230
- {nameMap['custom'].price(option.price)}
231
- {nameMap['custom'].monthlyPrice(
232
- option.monthlyPrice && option.monthlyPrice !== '0' ? Number(option.monthlyPrice) : getMontlyPriceFromPeriod(option.amount, option.currency, option.value)
233
- )}
234
- {nameMap['custom'].renewsText(getTimeFromPeriod(option.value))}
235
- </div>
236
- : (
237
- <div>
238
- <span className={largePrice ? 'ncf__payment-term__large-price' : ''}>
239
- {option.price}
240
- </span>
241
- {option.chargeOnText && (
242
- <p className="ncf__payment-term__charge-on-text">
243
- {option.chargeOnText}
244
- </p>
245
- )}
246
- </div>
247
- )
243
+ <div>
244
+ <span
245
+ className={largePrice ? 'ncf__payment-term__large-price' : ''}
246
+ >
247
+ {option.price}
248
+ </span>
249
+ {option.chargeOnText && (
250
+ <p className="ncf__payment-term__charge-on-text">
251
+ {option.chargeOnText}
252
+ </p>
253
+ )}
254
+ </div>
248
255
  )}
249
256
  </React.Fragment>
250
257
  );
251
258
  };
252
259
 
253
260
  const getTermDisplayName = () => {
254
-
255
261
  const showTrialCopyInTitle =
256
262
  option.isTrial && !isPrintOrBundle && !isEpaper;
257
263
 
258
- const defaultTitle = (option.name && nameMap[option.name]) ? nameMap[option.name].title : '';
264
+ const defaultTitle =
265
+ option.name && nameMap[option.name] ? nameMap[option.name].title : '';
259
266
 
260
267
  const title = isFixedTermOffer
261
268
  ? `${offerDisplayName} - ${defaultTitle}`
@@ -263,7 +270,9 @@ export function PaymentTerm ({
263
270
 
264
271
  let termDisplayName = '';
265
272
  if (showTrialCopyInTitle) {
266
- const termName = option.displayName ? option.displayName : 'Premium Digital';
273
+ const termName = option.displayName
274
+ ? option.displayName
275
+ : 'Premium Digital';
267
276
  termDisplayName = `Trial: ${termName} - `;
268
277
  }
269
278
 
@@ -161,13 +161,17 @@ describe('PaymentTerm', () => {
161
161
  monthlyPrice: '£1.67',
162
162
  };
163
163
  describe('non-trial terms', () => {
164
- const options = [{
165
- ...baseOptions,
166
- isTrial: false,
167
- }];
164
+ const options = [
165
+ {
166
+ ...baseOptions,
167
+ isTrial: false,
168
+ },
169
+ ];
168
170
  it('renders with time period only if trial.option == false', () => {
169
171
  const wrapper = shallow(<PaymentTerm options={options} />);
170
- expect(wrapper.find('.ncf__payment-term__label').text()).toMatch(/^Monthly .*$/);
172
+ expect(wrapper.find('.ncf__payment-term__label').text()).toMatch(
173
+ /^Monthly .*$/
174
+ );
171
175
  });
172
176
  });
173
177
  describe('getDisplayName', () => {
@@ -183,10 +187,12 @@ describe('PaymentTerm', () => {
183
187
  );
184
188
  });
185
189
  it('renders using displayName if available', () => {
186
- const options = [{
187
- ...trialOptions,
188
- displayName: 'someDisplayName',
189
- }];
190
+ const options = [
191
+ {
192
+ ...trialOptions,
193
+ displayName: 'someDisplayName',
194
+ },
195
+ ];
190
196
  const wrapper = shallow(<PaymentTerm options={options} />);
191
197
  expect(wrapper.find('.ncf__payment-term__label').text()).toMatch(
192
198
  /^Trial: someDisplayName - Monthly .*/
@@ -18,76 +18,76 @@ export const Basic = (args) => (
18
18
  Basic.args = {
19
19
  options: [
20
20
  {
21
- 'name': '2 yearly',
22
- 'isTrial': true,
23
- 'discount': '',
24
- 'selected': false,
25
- 'price': '$645.00',
26
- 'trialPrice': '$100.00',
27
- 'trialDuration': 'Trial period',
28
- 'monthlyPrice': '0',
29
- 'amount': '645.00',
30
- 'trialAmount': 100,
31
- 'value': 'P2Y',
32
- 'currency': 'USD'
21
+ name: '2 yearly',
22
+ isTrial: true,
23
+ discount: '',
24
+ selected: false,
25
+ price: '$645.00',
26
+ trialPrice: '$100.00',
27
+ trialDuration: 'Trial period',
28
+ monthlyPrice: '0',
29
+ amount: '645.00',
30
+ trialAmount: 100,
31
+ value: 'P2Y',
32
+ currency: 'USD',
33
33
  },
34
34
  {
35
- 'name': '3 yearly',
36
- 'isTrial': false,
37
- 'discount': '',
38
- 'selected': false,
39
- 'price': '$909.00',
40
- 'trialPrice': '$0.00',
41
- 'trialDuration': '',
42
- 'monthlyPrice': '0',
43
- 'amount': '909.00',
44
- 'trialAmount': null,
45
- 'value': 'P3Y',
46
- 'currency': 'USD'
47
- },
35
+ name: '3 yearly',
36
+ isTrial: false,
37
+ discount: '',
38
+ selected: false,
39
+ price: '$909.00',
40
+ trialPrice: '$0.00',
41
+ trialDuration: '',
42
+ monthlyPrice: '0',
43
+ amount: '909.00',
44
+ trialAmount: null,
45
+ value: 'P3Y',
46
+ currency: 'USD',
47
+ },
48
48
  {
49
- 'name': '6 monthly',
50
- 'isTrial': false,
51
- 'discount': '',
52
- 'selected': false,
53
- 'price': '$229.00',
54
- 'trialPrice': '$0.00',
55
- 'trialDuration': '',
56
- 'monthlyPrice': '0',
57
- 'amount': '229.00',
58
- 'trialAmount': null,
59
- 'value': 'P6M',
60
- 'currency': 'USD'
49
+ name: '6 monthly',
50
+ isTrial: false,
51
+ discount: '',
52
+ selected: false,
53
+ price: '$229.00',
54
+ trialPrice: '$0.00',
55
+ trialDuration: '',
56
+ monthlyPrice: '0',
57
+ amount: '229.00',
58
+ trialAmount: null,
59
+ value: 'P6M',
60
+ currency: 'USD',
61
61
  },
62
62
  {
63
- 'name': 'annual',
64
- 'isTrial': false,
65
- 'discount': '',
66
- 'selected': true,
67
- 'price': '$385.00',
68
- 'trialPrice': '$0.00',
69
- 'trialDuration': '',
70
- 'monthlyPrice': '$32.09',
71
- 'amount': '385.00',
72
- 'trialAmount': null,
73
- 'value': 'P1Y',
74
- 'currency': 'USD'
63
+ name: 'annual',
64
+ isTrial: false,
65
+ discount: '',
66
+ selected: true,
67
+ price: '$385.00',
68
+ trialPrice: '$0.00',
69
+ trialDuration: '',
70
+ monthlyPrice: '$32.09',
71
+ amount: '385.00',
72
+ trialAmount: null,
73
+ value: 'P1Y',
74
+ currency: 'USD',
75
75
  },
76
76
  {
77
- 'name': 'quarterly',
78
- 'isTrial': false,
79
- 'discount': '',
80
- 'selected': false,
81
- 'price': '$95.00',
82
- 'trialPrice': '$0.00',
83
- 'trialDuration': '',
84
- 'monthlyPrice': '$31.67',
85
- 'amount': '95.00',
86
- 'trialAmount': null,
87
- 'value': 'P3M',
88
- 'currency': 'USD'
89
- }
90
- ]
77
+ name: 'quarterly',
78
+ isTrial: false,
79
+ discount: '',
80
+ selected: false,
81
+ price: '$95.00',
82
+ trialPrice: '$0.00',
83
+ trialDuration: '',
84
+ monthlyPrice: '$31.67',
85
+ amount: '95.00',
86
+ trialAmount: null,
87
+ value: 'P3M',
88
+ currency: 'USD',
89
+ },
90
+ ],
91
91
  };
92
92
 
93
93
  export const FixedTermOffer = (args) => (
@@ -13,7 +13,7 @@ const PaypalCustomerCareMessage = () => {
13
13
  <div className="o-message__container">
14
14
  <div className="o-message__content">
15
15
  <p className="o-message__content-main">
16
- If you{'\''}d like to change your payment method to Paypal please{' '}
16
+ If you{"'"}d like to change your payment method to Paypal please{' '}
17
17
  <a
18
18
  className="o-message__actions__secondary"
19
19
  href="https://help.ft.com"
@@ -29,7 +29,7 @@ const PaypalCustomerCareMessage = () => {
29
29
  );
30
30
  };
31
31
 
32
- export function PaymentType ({
32
+ export function PaymentType({
33
33
  enableApplepay = false,
34
34
  enableCreditcard = false,
35
35
  enableDirectdebit = false,
@@ -103,7 +103,7 @@ export function PaymentType ({
103
103
  paymentTypePaypal(),
104
104
  paymentTypeDirectDebit,
105
105
  paymentTypeApplePay,
106
- paymentTypeBankTransfer
106
+ paymentTypeBankTransfer,
107
107
  ];
108
108
  return paymentTypes.map((type) => {
109
109
  if (type.id === undefined) {
@@ -196,6 +196,7 @@ export function PaymentType ({
196
196
  };
197
197
 
198
198
  const createZuoraPanel = () => {
199
+ // eslint-disable-next-line react/no-unknown-property
199
200
  return (
200
201
  (enableDirectdebit || enableCreditcard) && (
201
202
  <div className="ncf__payment-type-panel ncf__payment-type-panel--creditcard ncf__payment-type-panel--directdebit ncf__hidden">
@@ -207,7 +208,6 @@ export function PaymentType ({
207
208
  overflow="visible"
208
209
  scrolling="no"
209
210
  frameBorder="0"
210
- allowtransparency="true"
211
211
  className="z_hppm_iframe"
212
212
  style={{ display: 'block', width: '100%' }}
213
213
  ></iframe>
@@ -9,7 +9,7 @@ export const defaultPersonalTitles = [
9
9
  { code: 'Ms', description: 'Ms' },
10
10
  ];
11
11
 
12
- export function PersonalTitle ({
12
+ export function PersonalTitle({
13
13
  value,
14
14
  isDisabled = false,
15
15
  hasError = false,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import propTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
 
5
- export function Phone ({
5
+ export function Phone({
6
6
  hasError = false,
7
7
  isB2b = false,
8
8
  isDisabled = false,
@@ -5,7 +5,7 @@ import { b2b, demographics } from 'n-common-static-data';
5
5
  const B2CPositions = demographics.positions.positions;
6
6
  const B2BPositions = b2b.demographics.positions.positions;
7
7
 
8
- export function Position ({
8
+ export function Position({
9
9
  value,
10
10
  isDisabled = false,
11
11
  hasError = false,
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
 
5
- export function ProgressIndicator ({ items = [], disableLinks = false }) {
6
- function getElementsForComplete (item) {
5
+ export function ProgressIndicator({ items = [], disableLinks = false }) {
6
+ function getElementsForComplete(item) {
7
7
  return disableLinks ? (
8
8
  <span className="o-stepped-progress__step o-stepped-progress__step--complete">
9
9
  <span className="o-stepped-progress__label">
@@ -26,7 +26,7 @@ export function ProgressIndicator ({ items = [], disableLinks = false }) {
26
26
  );
27
27
  }
28
28
 
29
- function getElementsForNonComplete (item) {
29
+ function getElementsForNonComplete(item) {
30
30
  const nonCompleteDivClassName = classNames([
31
31
  'o-stepped-progress__step',
32
32
  { 'o-stepped-progress__step--current': item.isCurrent },
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import { canadianProvinces } from 'n-common-static-data';
5
5
  const defaultProvinces = canadianProvinces.provinces;
6
6
 
7
- export function Province ({
7
+ export function Province({
8
8
  value,
9
9
  fieldId = 'provinceField',
10
10
  selectId = 'province',
@@ -33,7 +33,7 @@ const STORES = [
33
33
  },
34
34
  ];
35
35
 
36
- export function RegistrationConfirmation ({
36
+ export function RegistrationConfirmation({
37
37
  email = EMAIL_DEFAULT_TEXT,
38
38
  returnUrl = '/',
39
39
  }) {
@@ -5,7 +5,7 @@ import { b2b, demographics } from 'n-common-static-data';
5
5
  const B2CResponsibilities = demographics.responsibilities.responsibilities;
6
6
  const B2BResponsibilities = b2b.demographics.responsibilities.responsibilities;
7
7
 
8
- export function Responsibility ({
8
+ export function Responsibility({
9
9
  value,
10
10
  isDisabled = false,
11
11
  isRequired = true,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function Section ({ children }) {
4
+ export function Section({ children }) {
5
5
  return (
6
6
  <div className="o-forms-section o-forms-section--wide">
7
7
  <div className="o-forms-section__message">{children}</div>
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import { americanStates } from 'n-common-static-data';
5
5
  const defaultStates = americanStates.states;
6
6
 
7
- export function State ({
7
+ export function State({
8
8
  value,
9
9
  fieldId = 'stateField',
10
10
  selectId = 'state',
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
 
5
- export function Submit ({
5
+ export function Submit({
6
6
  id = 'submitButton',
7
7
  isCentered = false,
8
8
  isDisabled = false,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
 
5
- export function TextInput ({
5
+ export function TextInput({
6
6
  dataTrackable,
7
7
  errorText = 'Please enter a value',
8
8
  fieldId,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function TrialBanner ({ trialDuration = '' }) {
4
+ export function TrialBanner({ trialDuration = '' }) {
5
5
  const durationMessage = trialDuration ? (
6
6
  <>
7
7
  <span className="ncf__strong">{trialDuration}</span>{' '}
@@ -73,7 +73,7 @@ function DeferredBillingTerms(_ref) {
73
73
  className: labelClassName
74
74
  }, /*#__PURE__*/_react["default"].createElement("span", {
75
75
  className: "ncf__paragraph"
76
- }, "Find out more about our cancellation policy in our ", ' ', /*#__PURE__*/_react["default"].createElement("a", {
76
+ }, "Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
77
77
  className: "ncf__link--external",
78
78
  href: "https://help.ft.com/legal-privacy/terms-and-conditions/",
79
79
  title: "FT Legal Terms and Conditions help page",
@@ -84,7 +84,7 @@ function DeferredBillingTerms(_ref) {
84
84
  className: labelClassName
85
85
  }, /*#__PURE__*/_react["default"].createElement("span", {
86
86
  className: "ncf__paragraph"
87
- }, "Please note that if you fail to make payment for your Deferred Billing Plan within the due date your subscription will be automatically cancelled.", ' ', " ", /*#__PURE__*/_react["default"].createElement("a", {
87
+ }, "Please note that if you fail to make payment for your Deferred Billing Plan within the due date your subscription will be automatically cancelled.", ' ', /*#__PURE__*/_react["default"].createElement("a", {
88
88
  className: "ncf__link--external",
89
89
  href: "https://help.ft.com/legal-privacy/terms-and-conditions/",
90
90
  title: "FT Legal Terms and Conditions help page",
@@ -101,7 +101,6 @@ function DeferredBillingTerms(_ref) {
101
101
  className: "o-forms-input__error"
102
102
  }, errorMessage))));
103
103
  }
104
- ;
105
104
  DeferredBillingTerms.propTypes = {
106
105
  hasError: _propTypes["default"].bool,
107
106
  isChecked: _propTypes["default"].bool,
@@ -143,7 +143,7 @@ function PaymentTerm(_ref) {
143
143
  trialPrice: function trialPrice(_trialPrice, trialPeriod) {
144
144
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Unless you cancel during your trial you will be billed", ' ', /*#__PURE__*/_react["default"].createElement("span", {
145
145
  className: "ncf__payment-term__price"
146
- }, _trialPrice), " per ", trialPeriod, "after the trial period.");
146
+ }, _trialPrice), " per", ' ', trialPeriod, "after the trial period.");
147
147
  },
148
148
  monthlyPrice: function monthlyPrice(_monthlyPrice) {
149
149
  return Boolean(_monthlyPrice) && /*#__PURE__*/_react["default"].createElement("span", {
@@ -24,7 +24,7 @@ var PaypalCustomerCareMessage = function PaypalCustomerCareMessage() {
24
24
  className: "o-message__content"
25
25
  }, /*#__PURE__*/_react["default"].createElement("p", {
26
26
  className: "o-message__content-main"
27
- }, "If you", '\'', "d like to change your payment method to Paypal please", ' ', /*#__PURE__*/_react["default"].createElement("a", {
27
+ }, "If you", "'", "d like to change your payment method to Paypal please", ' ', /*#__PURE__*/_react["default"].createElement("a", {
28
28
  className: "o-message__actions__secondary",
29
29
  href: "https://help.ft.com"
30
30
  }, "contact Customer Care"), ".")))));
@@ -141,6 +141,7 @@ function PaymentType(_ref) {
141
141
  }, /*#__PURE__*/_react["default"].createElement("li", null, "This Guarantee is offered by all banks and building societies that accept instructions to pay Direct Debits."), /*#__PURE__*/_react["default"].createElement("li", null, "If there are any changes to the amount, date or frequency of your Direct Debit GoCardless re: The Financial Times will notify you 3 working days in advance of your account being debited or as otherwise agreed. If you request GoCardless Ltd re: The Financial Times to collect a payment, confirmation of the amount and date will be given to you at the time of the request."), /*#__PURE__*/_react["default"].createElement("li", null, "If an error is made in the payment of your Direct Debit, by GoCardless Ltd re: The Financial Times or your bank or building society, you are entitled to a full and immediate refund of the amount paid from your bank or building society."), /*#__PURE__*/_react["default"].createElement("li", null, "If you receive a refund you are not entitled to, you must pay it back when GoCardless Ltd re: The Financial Times asks you to."), /*#__PURE__*/_react["default"].createElement("li", null, "You can cancel a Direct Debit at any time by simply contacting your bank or building society. Written confirmation may be required. Please also notify us."))));
142
142
  };
143
143
  var createZuoraPanel = function createZuoraPanel() {
144
+ // eslint-disable-next-line react/no-unknown-property
144
145
  return (enableDirectdebit || enableCreditcard) && /*#__PURE__*/_react["default"].createElement("div", {
145
146
  className: "ncf__payment-type-panel ncf__payment-type-panel--creditcard ncf__payment-type-panel--directdebit ncf__hidden"
146
147
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -154,7 +155,6 @@ function PaymentType(_ref) {
154
155
  overflow: "visible",
155
156
  scrolling: "no",
156
157
  frameBorder: "0",
157
- allowtransparency: "true",
158
158
  className: "z_hppm_iframe",
159
159
  style: {
160
160
  display: 'block',
package/helpers/index.js CHANGED
@@ -1,12 +1,15 @@
1
1
  module.exports = {
2
2
  'ncf-countries': require('./ncf-countries'),
3
3
  'ncf-common-data': require('./ncf-common-data'),
4
- 'cemeaV1ISO': require('./supportedCountries').cemeaV1ISO,
5
- 'cemeaV2ISO': require('./supportedCountries').cemeaV2ISO,
6
- 'apacISO': require('./supportedCountries').apacISO,
7
- 'identifyFTShippingZone': require('./supportedCountries').identifyFTShippingZone,
8
- 'countriesSupported': require('./supportedCountries').countriesSupported,
9
- 'countriesSupportedISO': require('./supportedCountries').countriesSupportedISO,
10
- 'supportedPostcodeValidators': require('./supportedPostcodeValidators').supportedPostcodeValidators,
11
- 'allSupportedPostcodeExamples': require('./supportedPostcodeExamples').allSupportedPostcodeExamples,
4
+ cemeaV1ISO: require('./supportedCountries').cemeaV1ISO,
5
+ cemeaV2ISO: require('./supportedCountries').cemeaV2ISO,
6
+ apacISO: require('./supportedCountries').apacISO,
7
+ identifyFTShippingZone: require('./supportedCountries')
8
+ .identifyFTShippingZone,
9
+ countriesSupported: require('./supportedCountries').countriesSupported,
10
+ countriesSupportedISO: require('./supportedCountries').countriesSupportedISO,
11
+ supportedPostcodeValidators: require('./supportedPostcodeValidators')
12
+ .supportedPostcodeValidators,
13
+ allSupportedPostcodeExamples: require('./supportedPostcodeExamples')
14
+ .allSupportedPostcodeExamples,
12
15
  };
@@ -118,7 +118,7 @@ describe('ncf-countries', () => {
118
118
  });
119
119
  });
120
120
 
121
- function generateCountryArray (length, { includeAllFrequent = true } = {}) {
121
+ function generateCountryArray(length, { includeAllFrequent = true } = {}) {
122
122
  return Array.from(Array(length), (item, index) => ({
123
123
  code: `C-${index}`,
124
124
  })).concat(