@financial-times/n-conversion-forms 27.7.1 → 28.0.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.
Files changed (119) hide show
  1. package/.eslintignore +1 -0
  2. package/build-state/npm-shrinkwrap.json +1808 -1324
  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/styles/message.scss +0 -16
  82. package/test-jest/helpers/expect-to-render-correctly.js +1 -1
  83. package/utils/app-banner.js +1 -1
  84. package/utils/apple-pay.js +15 -15
  85. package/utils/billing-city.js +1 -1
  86. package/utils/billing-country.js +3 -3
  87. package/utils/billing-postcode.js +1 -1
  88. package/utils/company-name.js +1 -1
  89. package/utils/countries.js +2 -2
  90. package/utils/country.js +3 -3
  91. package/utils/delivery-address-type.js +3 -3
  92. package/utils/delivery-address-type.spec.js +6 -2
  93. package/utils/delivery-address.js +1 -1
  94. package/utils/delivery-instructions.js +1 -1
  95. package/utils/delivery-option-messages.js +11 -11
  96. package/utils/delivery-option-messages.spec.js +4 -13
  97. package/utils/delivery-option.js +5 -5
  98. package/utils/delivery-po-box.js +1 -1
  99. package/utils/delivery-postcode.js +1 -1
  100. package/utils/delivery-start-date.js +4 -4
  101. package/utils/delivery-start-date.spec.js +3 -2
  102. package/utils/email.js +4 -4
  103. package/utils/email.spec.js +2 -1
  104. package/utils/event-notifier.js +1 -1
  105. package/utils/form-element.js +8 -8
  106. package/utils/loader.js +10 -10
  107. package/utils/password.js +2 -2
  108. package/utils/payment-term.js +16 -15
  109. package/utils/payment-type.js +14 -14
  110. package/utils/postcode.js +3 -3
  111. package/utils/postcode.spec.js +21 -12
  112. package/utils/province.js +1 -1
  113. package/utils/salesforce.js +2 -2
  114. package/utils/state.js +1 -1
  115. package/utils/submit.js +5 -5
  116. package/utils/tracking.js +7 -7
  117. package/utils/validation.js +18 -11
  118. package/utils/zuora-error-map.js +5 -5
  119. package/utils/zuora.js +17 -12
@@ -461,7 +461,6 @@ exports[`PaymentType render with enableCreditcard 1`] = `
461
461
  overflow="visible"
462
462
  scrolling="no"
463
463
  frameborder="0"
464
- allowtransparency="true"
465
464
  class="z_hppm_iframe"
466
465
  style="display:block;width:100%"
467
466
  >
@@ -611,7 +610,6 @@ exports[`PaymentType render with enableDirectdebit 1`] = `
611
610
  overflow="visible"
612
611
  scrolling="no"
613
612
  frameborder="0"
614
- allowtransparency="true"
615
613
  class="z_hppm_iframe"
616
614
  style="display:block;width:100%"
617
615
  >
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
 
5
5
  const DEFAULT_AGE_RESTRICTION = '16';
6
6
 
7
- export function AcceptTerms ({
7
+ export function AcceptTerms({
8
8
  isAuthFirstAccount = false,
9
9
  isAuthFirstPayment = false,
10
10
  hasError = false,
@@ -52,7 +52,7 @@ export function AcceptTerms ({
52
52
 
53
53
  const authFirstStepTerms = (
54
54
  <>
55
- {(
55
+ {
56
56
  <ul className="o-typography-list ncf__accept-terms-list">
57
57
  <li>
58
58
  <span className="terms-auth-first-step">
@@ -81,7 +81,7 @@ export function AcceptTerms ({
81
81
  </span>
82
82
  </li>
83
83
  </ul>
84
- )}
84
+ }
85
85
  {!hideConfirmTermsAndConditions && (
86
86
  <label className={labelClassName} htmlFor="termsAcceptance">
87
87
  <input {...inputProps} />
@@ -216,11 +216,12 @@ export function AcceptTerms ({
216
216
  <li>
217
217
  <span className="terms-transition terms-transition--immediate">
218
218
  By placing my order, my subscription will start immediately and I am
219
- aware and agree that I will therefore lose my statutory right to cancel my
220
- subscription within 14 days of acceptance of my order. Any notice of
221
- cancellation that I provide will only take effect at the end of my subscription
222
- period and previously paid amounts are non-refundable, except in the event that
223
- there is a fault in the provision of the services.
219
+ aware and agree that I will therefore lose my statutory right to
220
+ cancel my subscription within 14 days of acceptance of my order. Any
221
+ notice of cancellation that I provide will only take effect at the
222
+ end of my subscription period and previously paid amounts are
223
+ non-refundable, except in the event that there is a fault in the
224
+ provision of the services.
224
225
  </span>
225
226
  </li>
226
227
  ) : (
@@ -299,12 +300,13 @@ export function AcceptTerms ({
299
300
  </li>
300
301
  <li>
301
302
  <span className="terms-signup">
302
- By placing my order, my subscription will start immediately and I am
303
- aware and agree that I will therefore lose my statutory right to cancel
304
- my subscription within 14 days of acceptance of my order. Any notice of
305
- cancellation that I provide will only take effect at the end of my
306
- subscription period and previously paid amounts are non-refundable,
307
- except in the event that there is a fault in the provision of the services.
303
+ By placing my order, my subscription will start immediately and I
304
+ am aware and agree that I will therefore lose my statutory right
305
+ to cancel my subscription within 14 days of acceptance of my
306
+ order. Any notice of cancellation that I provide will only take
307
+ effect at the end of my subscription period and previously paid
308
+ amounts are non-refundable, except in the event that there is a
309
+ fault in the provision of the services.
308
310
  </span>
309
311
  </li>
310
312
  <li>
@@ -335,8 +337,8 @@ export function AcceptTerms ({
335
337
  const deferredBillingTerms = isDeferredBilling && (
336
338
  <li>
337
339
  <span className="terms-deferred">
338
- Please note if you fail to make payment for your deferred billing plan within due
339
- date your subscription will be automatically cancelled.
340
+ Please note if you fail to make payment for your deferred billing plan
341
+ within due date your subscription will be automatically cancelled.
340
342
  </span>
341
343
  </li>
342
344
  );
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- export function AppBanner () {
3
+ export function AppBanner() {
4
4
  return (
5
5
  <div id="appBanner" className="ncf ncf__app-banner">
6
6
  <div className="ncf__app-banner-inner">
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function B2CPartnershipConfirmation ({ ctaElement = null }) {
4
+ export function B2CPartnershipConfirmation({ ctaElement = null }) {
5
5
  const readingLinkProps = {
6
6
  href: '/',
7
7
  className: 'ncf__link',
@@ -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 BillingCity ({
5
+ export function BillingCity({
6
6
  hasError = false,
7
7
  value = '',
8
8
  isDisabled = false,
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import { getCountries } from '../utils/countries';
5
5
 
6
- export function BillingCountry ({
6
+ export function BillingCountry({
7
7
  fieldId = 'billingCountryField',
8
8
  filterList = [],
9
9
  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 BillingPostcode ({
5
+ export function BillingPostcode({
6
6
  postcodeReference,
7
7
  value = '',
8
8
  pattern = null,
@@ -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 CompanyName ({
5
+ export function CompanyName({
6
6
  fieldId = 'companyNameField',
7
7
  hasError = false,
8
8
  inputId = 'companyName',
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
 
4
4
  const EMAIL_DEFAULT_TEXT = 'your email';
5
5
 
6
- export function Confirmation ({
6
+ export function Confirmation({
7
7
  // isTrial prop is needed for the floodlight pixel tracking.
8
8
  isTrial = false,
9
9
  isB2cPartnership = false,
@@ -20,7 +20,8 @@ export function Confirmation ({
20
20
  ...(isTrial && { 'data-signup-is-trial': 'true' }),
21
21
  };
22
22
 
23
- const isB2cPartnershipCopyAvailable = isB2cPartnership && b2cPartnershipCopy.length > 0;
23
+ const isB2cPartnershipCopyAvailable =
24
+ isB2cPartnership && b2cPartnershipCopy.length > 0;
24
25
 
25
26
  const detailElements = details && (
26
27
  <React.Fragment>
@@ -68,8 +69,8 @@ export function Confirmation ({
68
69
  {nextActionTop}
69
70
  {!isB2cPartnershipCopyAvailable && (
70
71
  <p className="ncf__paragraph">
71
- We’ve sent confirmation to {email}. Make sure you check your spam folder
72
- if you don’t receive it.
72
+ We’ve sent confirmation to {email}. Make sure you check your spam
73
+ folder if you don’t receive it.
73
74
  </p>
74
75
  )}
75
76
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function ContinueReading ({
4
+ export function ContinueReading({
5
5
  link = null,
6
6
  quote = '',
7
7
  isEmbedded = false,
@@ -9,6 +9,6 @@ export default {
9
9
  export const Basic = (args) => <ContinueReading {...args} />;
10
10
  Basic.args = {
11
11
  quote:
12
- 'The problem with quotes found on the internet, is that they\'re often not true - Abraham Lincoln',
12
+ "The problem with quotes found on the internet, is that they're often not true - Abraham Lincoln",
13
13
  link: 'https://ft.com/world',
14
14
  };
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import { getCountries } from '../utils/countries';
5
5
 
6
- export function Country ({
6
+ export function Country({
7
7
  fieldId = 'countryField',
8
8
  filterList = [],
9
9
  hasError = false,
@@ -6,7 +6,7 @@ const DEFAULT_HEADER_TEXT = 'Sorry, this is not available online';
6
6
  const DEFAULT_MESSAGE_TEXT =
7
7
  'Speak now to our Customer Care team to discuss your options';
8
8
 
9
- export function CustomerCare ({
9
+ export function CustomerCare({
10
10
  header = DEFAULT_HEADER_TEXT,
11
11
  isCompact = false,
12
12
  message = DEFAULT_MESSAGE_TEXT,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function Debug ({ isTest = false, showHelpers = false, links = {} }) {
4
+ export function Debug({ isTest = false, showHelpers = false, links = {} }) {
5
5
  // Strings are used rather than JSX as this component is injected into HTML
6
6
  // along with onclick handlers, styles and javascript. JSX will escape and
7
7
  // modify the HTML which we do not want. Once our applications are on JSX
@@ -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 DecisionMaker ({ hasError = false, value = 'yes' }) {
5
+ export function DecisionMaker({ hasError = false, value = 'yes' }) {
6
6
  const radioButtonsWrapperClassNames = classNames([
7
7
  'o-forms-input',
8
8
  'o-forms-input--radio-box',
@@ -16,7 +16,7 @@ describe('DecisionMaker', () => {
16
16
  expect(DecisionMaker).toRenderCorrectly(props);
17
17
  });
18
18
 
19
- it('renders with \'no\' as default state for radio buttons', () => {
19
+ it("renders with 'no' as default state for radio buttons", () => {
20
20
  const props = { value: 'no' };
21
21
 
22
22
  expect(DecisionMaker).toRenderCorrectly(props);
@@ -2,7 +2,16 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  const CONSENT_AGE = 16;
5
- export function DeferredBillingTerms ({ isDeferredBilling = false, checkBoxTrackableAttr = 'field-terms', trackableAttr = 'deferred-billing-terms', errorMessage = 'Please accept our terms &amp; conditions', inputId = 'accept-deferred-billing-terms', fieldId = 'accept-deferred-terms', isChecked = false, hasError = false }) {
5
+ export function DeferredBillingTerms({
6
+ isDeferredBilling = false,
7
+ checkBoxTrackableAttr = 'field-terms',
8
+ trackableAttr = 'deferred-billing-terms',
9
+ errorMessage = 'Please accept our terms &amp; conditions',
10
+ inputId = 'accept-deferred-billing-terms',
11
+ fieldId = 'accept-deferred-terms',
12
+ isChecked = false,
13
+ hasError = false,
14
+ }) {
6
15
  const labelClassName = classNames([
7
16
  'o-forms-input',
8
17
  'o-forms-input--checkbox',
@@ -25,81 +34,88 @@ export function DeferredBillingTerms ({ isDeferredBilling = false, checkBoxTrack
25
34
  'data-validate': 'required,checked',
26
35
  ...(isChecked && { 'data-trackable': trackableAttr }),
27
36
  };
28
- return isDeferredBilling && (<>
29
- <p className={labelClassName}>
30
- <span className="ncf__paragraph">
31
- I confirm I am {CONSENT_AGE} years or older and have read and agree to the
32
- {' '}
33
- <a
34
- className="ncf__link--external"
35
- href="https://help.ft.com/legal-privacy/terms-and-conditions/"
36
- title="FT Legal Terms and Conditions help page"
37
- target="_blank"
38
- rel="noopener noreferrer"
39
- data-trackable="terms-and-conditions"
40
- >
41
- Terms &amp; Conditions
42
- </a>
43
- .
44
- </span>
45
- </p>
46
- <p className={labelClassName}>
47
- <span className="ncf__paragraph">
48
- I give consent for my chosen payment method to be charged automatically at the end of each subscription term until I cancel it by contacting Customer Care through chat, phone or email.
49
- </span>
50
- </p>
51
- <p className={labelClassName}>
52
- <span className="ncf__paragraph">
53
- By placing my order, I acknowledge that my subscription will start on the date given above. Any cancellation notice received after that date will take effect at the end of my subscription term and previously paid amounts are non-refundable.
54
- </span>
55
- </p>
56
- <p className={labelClassName}>
57
- <span className="ncf__paragraph">
58
- Find out more about our cancellation policy in our {' '}
59
- <a
60
- className="ncf__link--external"
61
- href="https://help.ft.com/legal-privacy/terms-and-conditions/"
62
- title="FT Legal Terms and Conditions help page"
63
- target="_blank"
64
- rel="noopener noreferrer"
65
- data-trackable="terms-and-conditions"
66
- >
67
- Terms &amp; Conditions
68
- </a>
69
- .
70
- </span>
71
- </p>
72
- <p className={labelClassName}>
73
- <span className="ncf__paragraph">
74
- Please note that if you fail to make payment for your Deferred Billing Plan within the due date your subscription will be automatically cancelled.
75
- {' '} <a
76
- className="ncf__link--external"
77
- href="https://help.ft.com/legal-privacy/terms-and-conditions/"
78
- title="FT Legal Terms and Conditions help page"
79
- target="_blank"
80
- rel="noopener noreferrer"
81
- data-trackable="terms-and-conditions"
82
- >
83
- Terms &amp; Conditions
84
- </a>
85
- .
86
- </span>
87
- </p>
88
- <div {...divProps}>
89
- <label className={labelClassName} htmlFor={inputId} id={fieldId}>
90
- <input {...inputProps} />
91
- <span className="o-forms-input__label">
92
- I agree with terms &amp; conditions.
93
-
94
- </span>
95
- <p className="o-forms-input__error">
96
- {errorMessage}
37
+ return (
38
+ isDeferredBilling && (
39
+ <>
40
+ <p className={labelClassName}>
41
+ <span className="ncf__paragraph">
42
+ I confirm I am {CONSENT_AGE} years or older and have read and agree
43
+ to the{' '}
44
+ <a
45
+ className="ncf__link--external"
46
+ href="https://help.ft.com/legal-privacy/terms-and-conditions/"
47
+ title="FT Legal Terms and Conditions help page"
48
+ target="_blank"
49
+ rel="noopener noreferrer"
50
+ data-trackable="terms-and-conditions"
51
+ >
52
+ Terms &amp; Conditions
53
+ </a>
54
+ .
55
+ </span>
97
56
  </p>
98
- </label>
99
- </div>
100
- </>);
101
-
102
- };
57
+ <p className={labelClassName}>
58
+ <span className="ncf__paragraph">
59
+ I give consent for my chosen payment method to be charged
60
+ automatically at the end of each subscription term until I cancel it
61
+ by contacting Customer Care through chat, phone or email.
62
+ </span>
63
+ </p>
64
+ <p className={labelClassName}>
65
+ <span className="ncf__paragraph">
66
+ By placing my order, I acknowledge that my subscription will start
67
+ on the date given above. Any cancellation notice received after that
68
+ date will take effect at the end of my subscription term and
69
+ previously paid amounts are non-refundable.
70
+ </span>
71
+ </p>
72
+ <p className={labelClassName}>
73
+ <span className="ncf__paragraph">
74
+ Find out more about our cancellation policy in our{' '}
75
+ <a
76
+ className="ncf__link--external"
77
+ href="https://help.ft.com/legal-privacy/terms-and-conditions/"
78
+ title="FT Legal Terms and Conditions help page"
79
+ target="_blank"
80
+ rel="noopener noreferrer"
81
+ data-trackable="terms-and-conditions"
82
+ >
83
+ Terms &amp; Conditions
84
+ </a>
85
+ .
86
+ </span>
87
+ </p>
88
+ <p className={labelClassName}>
89
+ <span className="ncf__paragraph">
90
+ Please note that if you fail to make payment for your Deferred
91
+ Billing Plan within the due date your subscription will be
92
+ automatically cancelled.{' '}
93
+ <a
94
+ className="ncf__link--external"
95
+ href="https://help.ft.com/legal-privacy/terms-and-conditions/"
96
+ title="FT Legal Terms and Conditions help page"
97
+ target="_blank"
98
+ rel="noopener noreferrer"
99
+ data-trackable="terms-and-conditions"
100
+ >
101
+ Terms &amp; Conditions
102
+ </a>
103
+ .
104
+ </span>
105
+ </p>
106
+ <div {...divProps}>
107
+ <label className={labelClassName} htmlFor={inputId} id={fieldId}>
108
+ <input {...inputProps} />
109
+ <span className="o-forms-input__label">
110
+ I agree with terms &amp; conditions.
111
+ </span>
112
+ <p className="o-forms-input__error">{errorMessage}</p>
113
+ </label>
114
+ </div>
115
+ </>
116
+ )
117
+ );
118
+ }
103
119
 
104
120
  DeferredBillingTerms.propTypes = {
105
121
  hasError: PropTypes.bool,
@@ -108,5 +124,5 @@ DeferredBillingTerms.propTypes = {
108
124
  fieldId: PropTypes.string,
109
125
  inputId: PropTypes.string,
110
126
  trackableAttr: PropTypes.string,
111
- errorMessage: PropTypes.string
127
+ errorMessage: PropTypes.string,
112
128
  };
@@ -29,7 +29,11 @@ describe('DeferredBillingTerms', () => {
29
29
  });
30
30
 
31
31
  it('renders appropriately if all props are set to false - no rendering of the component', () => {
32
- const props = { isChecked: false, isDeferredBilling: false, hasError: false };
32
+ const props = {
33
+ isChecked: false,
34
+ isDeferredBilling: false,
35
+ hasError: false,
36
+ };
33
37
 
34
38
  expect(DeferredBillingTerms).toRenderCorrectly(props);
35
39
  });
@@ -11,8 +11,8 @@ export default {
11
11
  fieldId: { control: 'string' },
12
12
  trackableAttr: { control: 'string' },
13
13
  errorMessage: { control: 'string' },
14
- isDeferredBilling: { control: 'boolean' }
15
- }
14
+ isDeferredBilling: { control: 'boolean' },
15
+ },
16
16
  };
17
17
 
18
18
  export const Basic = (args) => <DeferredBillingTerms {...args} />;
@@ -22,5 +22,5 @@ export const CheckedFlow = (args) => <DeferredBillingTerms {...args} />;
22
22
  CheckedFlow.args = {
23
23
  isChecked: true,
24
24
  isDeferredBilling: true,
25
- hasError: false
25
+ hasError: false,
26
26
  };
@@ -7,13 +7,13 @@ const addressTypes = [
7
7
  { id: 'pobox', label: 'P.O. Box' },
8
8
  ];
9
9
 
10
- export function DeliveryAddressType ({
10
+ export function DeliveryAddressType({
11
11
  value = 'home',
12
12
  fieldId = 'deliveryAddressTypeField',
13
13
  inputName = 'deliveryAddressType',
14
14
  options = ['home', 'company', 'pobox'],
15
15
  editMode = false,
16
- titlePrompt = ''
16
+ titlePrompt = '',
17
17
  }) {
18
18
  return (
19
19
  <div
@@ -39,7 +39,7 @@ export function DeliveryAddressType ({
39
39
  name={inputName}
40
40
  value={type.id}
41
41
  className="ncf__delivery-address-type__input"
42
- disabled={editMode && (type.id !== value)}
42
+ disabled={editMode && type.id !== value}
43
43
  defaultChecked={type.id === value}
44
44
  />
45
45
  <span
@@ -61,5 +61,5 @@ DeliveryAddressType.propTypes = {
61
61
  inputName: PropTypes.string,
62
62
  value: PropTypes.oneOf(['home', 'company', 'pobox']),
63
63
  options: PropTypes.arrayOf(PropTypes.oneOf(['home', 'company', 'pobox'])),
64
- titlePrompt:PropTypes.string,
64
+ titlePrompt: PropTypes.string,
65
65
  };
@@ -12,7 +12,7 @@ import {
12
12
  countriesSupportedISO,
13
13
  } from '../helpers/supportedCountries';
14
14
 
15
- export function DeliveryAddress ({
15
+ export function DeliveryAddress({
16
16
  fieldId = 'deliveryAddressFields',
17
17
  hasError = false,
18
18
  line1 = '',
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- import { countriesSupportedISO, identifyFTShippingZone } from '../helpers/supportedCountries';
4
+ import {
5
+ countriesSupportedISO,
6
+ identifyFTShippingZone,
7
+ } from '../helpers/supportedCountries';
5
8
 
6
-
7
- export function DeliveryCity ({
9
+ export function DeliveryCity({
8
10
  hasError = false,
9
11
  value = '',
10
12
  isDisabled = false,
@@ -20,7 +22,7 @@ export function DeliveryCity ({
20
22
  GBR: 'e.g. Bath',
21
23
  USA: 'e.g. Los Angeles',
22
24
  CAN: 'e.g. Montreal',
23
- ARE: 'e.g. Dubai'
25
+ ARE: 'e.g. Dubai',
24
26
  };
25
27
  const FTShippingZone = identifyFTShippingZone(country);
26
28
 
@@ -29,7 +31,9 @@ export function DeliveryCity ({
29
31
  APAC: 'City/Prefecture',
30
32
  DEFAULT: 'City',
31
33
  };
32
- const inputLabel = labelMapping[FTShippingZone] ? labelMapping[FTShippingZone] : labelMapping['DEFAULT'];
34
+ const inputLabel = labelMapping[FTShippingZone]
35
+ ? labelMapping[FTShippingZone]
36
+ : labelMapping['DEFAULT'];
33
37
 
34
38
  return (
35
39
  <label
@@ -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 DeliveryCounty ({
5
+ export function DeliveryCounty({
6
6
  hasError = false,
7
7
  value = '',
8
8
  isDisabled = false,