@financial-times/n-conversion-forms 36.0.3 → 37.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.
package/.eslintignore CHANGED
@@ -7,4 +7,5 @@ package-lock.json
7
7
  *.sh
8
8
  .*
9
9
  *.feature
10
- /docs
10
+ /docs
11
+ *.scss
@@ -10,6 +10,9 @@
10
10
  | ------ | ----- |
11
11
  | | |
12
12
 
13
+ ### Semantic versioning
14
+ <!-- What is the proposed release type (i.e. major, minor, path) for these changes and the rationale? -->
15
+
13
16
  ### Reminder
14
17
  Have you completed these common tasks (remove those that don't apply)?
15
18
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "0a2ec27eb0b55953ba765463b2033c4610e1e897",
5
- "tag": "v36.0.3"
4
+ "version": "386e3356ff251ce8366db3384b1648521b3fd5b6",
5
+ "tag": "v37.0.0"
6
6
  }
@@ -72,9 +72,7 @@ export function PaymentType({
72
72
  };
73
73
 
74
74
  const paymentTypePaypal = () => {
75
- if (showPaypalCustomerCareMessage) {
76
- return PaypalCustomerCareMessage();
77
- } else {
75
+ if (!showPaypalCustomerCareMessage) {
78
76
  return { id: 'paypal', label: 'PayPal', hide: !enablePaypal };
79
77
  }
80
78
  };
@@ -104,7 +102,8 @@ export function PaymentType({
104
102
  paymentTypeDirectDebit,
105
103
  paymentTypeApplePay,
106
104
  paymentTypeBankTransfer,
107
- ];
105
+ ].filter(Boolean);
106
+
108
107
  return paymentTypes.map((type) => {
109
108
  if (type.id === undefined) {
110
109
  return type;
@@ -239,7 +238,6 @@ export function PaymentType({
239
238
  checked: true,
240
239
  ...(isSingleTermChecked && { defaultChecked: true }),
241
240
  };
242
-
243
241
  return (
244
242
  <React.Fragment>
245
243
  {createSecuritySeal()}
@@ -252,24 +250,21 @@ export function PaymentType({
252
250
  <div className="o-forms-input__error">
253
251
  Please enter a valid payment type
254
252
  </div>
255
-
253
+ {showPaypalCustomerCareMessage && PaypalCustomerCareMessage()}
256
254
  {createDirectDebitPanel()}
257
-
258
255
  {createZuoraPanel()}
259
256
  </div>
260
257
  <div className="o-forms-field">
261
258
  {isSingleTerm && (
262
- <>
263
- <label
264
- className="o-forms-input o-forms-input--checkbox o-forms-input--suffix ncf__payment-type-pay-faster-next-time-checkbox"
265
- htmlFor="payFasterNextTime"
266
- >
267
- <input {...inputCheckProps} />
268
- <span className="o-forms-input__label">
269
- Use these details to pay faster next time
270
- </span>
271
- </label>
272
- </>
259
+ <label
260
+ className="o-forms-input o-forms-input--checkbox o-forms-input--suffix ncf__payment-type-pay-faster-next-time-checkbox"
261
+ htmlFor="payFasterNextTime"
262
+ >
263
+ <input {...inputCheckProps} />
264
+ <span className="o-forms-input__label">
265
+ Use these details to pay faster next time
266
+ </span>
267
+ </label>
273
268
  )}
274
269
  </div>
275
270
  </React.Fragment>
@@ -67,9 +67,7 @@ function PaymentType(_ref) {
67
67
  hide: !enableCreditcard
68
68
  };
69
69
  var paymentTypePaypal = function paymentTypePaypal() {
70
- if (showPaypalCustomerCareMessage) {
71
- return PaypalCustomerCareMessage();
72
- } else {
70
+ if (!showPaypalCustomerCareMessage) {
73
71
  return {
74
72
  id: 'paypal',
75
73
  label: 'PayPal',
@@ -93,7 +91,7 @@ function PaymentType(_ref) {
93
91
  hide: !enableBankTransfer
94
92
  };
95
93
  var createPaymentTypes = function createPaymentTypes() {
96
- var paymentTypes = [paymentTypeCreditCard, paymentTypePaypal(), paymentTypeDirectDebit, paymentTypeApplePay, paymentTypeBankTransfer];
94
+ var paymentTypes = [paymentTypeCreditCard, paymentTypePaypal(), paymentTypeDirectDebit, paymentTypeApplePay, paymentTypeBankTransfer].filter(Boolean);
97
95
  return paymentTypes.map(function (type) {
98
96
  if (type.id === undefined) {
99
97
  return type;
@@ -188,14 +186,14 @@ function PaymentType(_ref) {
188
186
  className: "o-forms-input o-forms-input--radio-box ncf__payment-type-selector"
189
187
  }, createPaymentTypes()), /*#__PURE__*/_react["default"].createElement("div", {
190
188
  className: "o-forms-input__error"
191
- }, "Please enter a valid payment type"), createDirectDebitPanel(), createZuoraPanel()), /*#__PURE__*/_react["default"].createElement("div", {
189
+ }, "Please enter a valid payment type"), showPaypalCustomerCareMessage && PaypalCustomerCareMessage(), createDirectDebitPanel(), createZuoraPanel()), /*#__PURE__*/_react["default"].createElement("div", {
192
190
  className: "o-forms-field"
193
- }, isSingleTerm && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("label", {
191
+ }, isSingleTerm && /*#__PURE__*/_react["default"].createElement("label", {
194
192
  className: "o-forms-input o-forms-input--checkbox o-forms-input--suffix ncf__payment-type-pay-faster-next-time-checkbox",
195
193
  htmlFor: "payFasterNextTime"
196
194
  }, /*#__PURE__*/_react["default"].createElement("input", inputCheckProps), /*#__PURE__*/_react["default"].createElement("span", {
197
195
  className: "o-forms-input__label"
198
- }, "Use these details to pay faster next time")))));
196
+ }, "Use these details to pay faster next time"))));
199
197
  }
200
198
  PaymentType.propTypes = {
201
199
  enableApplepay: _propTypes["default"].bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "36.0.3",
3
+ "version": "37.0.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  }
11
11
 
12
12
  @mixin ncfPaymentType() {
13
+
13
14
  // #1 - Need to be this specific to override specific o-forms styles.
14
15
  // Helps us override the floating of the radio box so that we can have it
15
16
  // full width.
@@ -21,6 +22,7 @@
21
22
  // #1
22
23
  display: block;
23
24
  margin-bottom: oSpacingByName('s3');
25
+ width: 100%;
24
26
 
25
27
  &:last-child {
26
28
  margin-bottom: 0;
@@ -33,17 +35,27 @@
33
35
  }
34
36
 
35
37
  &-selector {
36
- margin-top: 0;
38
+ display: flex;
39
+ flex-direction: column;
40
+ justify-content: space-evenly;
41
+ align-items: baseline;
42
+ margin-bottom: oSpacingByName('s3');
43
+
44
+ @include oGridRespondTo($from: L) {
45
+ flex-direction: row;
46
+ gap: oSpacingByName('s2');
47
+ }
37
48
  }
38
49
 
39
50
  .o-forms-input--radio-box &--paypal {
51
+
40
52
  // #2
41
- [type='radio'] + .o-forms-input__label {
53
+ [type='radio']+.o-forms-input__label {
42
54
  @include buttonImageOverriding();
43
55
  background-image: url(https://www.ft.com/__origami/service/image/v2/images/raw/%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fthird-party%2Fpp-logo-100px.png?width=300&source=next&fit=scale-down);
44
56
  }
45
57
 
46
- [type='radio']:checked + .o-forms-input__label {
58
+ [type='radio']:checked+.o-forms-input__label {
47
59
  @include buttonImageOverriding();
48
60
  background-image: url(https://www.ft.com/__origami/service/image/v2/images/raw/%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fthird-party%2Fpp-logo-white.png?width=300&source=next&fit=scale-down);
49
61
  }
@@ -52,12 +64,12 @@
52
64
 
53
65
  .o-forms-input--radio-box &--directdebit {
54
66
  // #2
55
- [type='radio'] + .o-forms-input__label {
67
+ [type='radio']+.o-forms-input__label {
56
68
  @include buttonImageOverriding();
57
69
  background-image: url(https://www.ft.com/__origami/service/image/v2/images/raw/%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fthird-party%2Fdirect_debit.png?width=300&source=next&fit=scale-down);
58
70
  }
59
71
 
60
- [type='radio']:checked + .o-forms-input__label {
72
+ [type='radio']:checked+.o-forms-input__label {
61
73
  @include buttonImageOverriding();
62
74
  background-image: url(https://www.ft.com/__origami/service/image/v2/images/raw/%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fthird-party%2Fdirect_debit-white.png?width=300&source=next&fit=scale-down);
63
75
  }
@@ -113,4 +125,4 @@
113
125
 
114
126
  .o-forms-input.o-forms-input--checkbox.o-forms-input--suffix.ncf__payment-type-pay-faster-next-time-checkbox {
115
127
  margin-top: oSpacingByName('s3');
116
- }
128
+ }