@financial-times/n-conversion-forms 37.2.2 → 37.3.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.
@@ -5,7 +5,7 @@ orbs:
5
5
  executors:
6
6
  node:
7
7
  docker:
8
- - image: cimg/node:18.17-browsers
8
+ - image: cimg/node:22.7-browsers
9
9
  jobs:
10
10
  checkout:
11
11
  docker:
package/.toolkitrc.yml CHANGED
@@ -18,7 +18,7 @@ hooks:
18
18
  - RunStorybook
19
19
  options:
20
20
  "@dotcom-tool-kit/circleci":
21
- nodeVersion: 18.17-browsers
21
+ nodeVersion: 22.7-browsers
22
22
  "@dotcom-tool-kit/babel":
23
23
  files: "components/{*.jsx,index.js}"
24
24
  outputPath: dist
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "c9dd25fe954591fd5d8e7167bdd51ff78d765bb3",
5
- "tag": "v37.2.2"
4
+ "version": "a93af32641c5a2b8e2ed414046f5574052edf44a",
5
+ "tag": "v37.3.0"
6
6
  }
@@ -190,6 +190,15 @@ export function PaymentTerm({
190
190
  };
191
191
 
192
192
  const createDiscount = () => {
193
+ // We need to display a specific text in the discount tile for H2 campaign offers.
194
+ // This is a TEMPORARY hack and will be removed once the campaign is over (Monday, October 28th).
195
+ // A ticket has been raised to deal with the clean-up: https://financialtimes.atlassian.net/browse/ACQ-2970.
196
+ if (option.specialOffer) {
197
+ return (
198
+ <span className="ncf__payment-term__discount">Special offer</span>
199
+ );
200
+ }
201
+
193
202
  return (
194
203
  option.discount && (
195
204
  <span className="ncf__payment-term__discount">
@@ -245,7 +254,7 @@ export function PaymentTerm({
245
254
  option.amount,
246
255
  option.currency,
247
256
  option.value
248
- )
257
+ )
249
258
  )}
250
259
  {nameMap['custom'].renewsText(getTimeFromPeriod(option.value))}
251
260
  </div>
@@ -420,6 +429,7 @@ PaymentTerm.propTypes = {
420
429
  title: PropTypes.string,
421
430
  subTitle: PropTypes.string,
422
431
  bestOffer: PropTypes.bool,
432
+ specialOffer: PropTypes.bool,
423
433
  chargeOnText: PropTypes.string,
424
434
  fulfilmentOption: PropTypes.string,
425
435
  })
@@ -132,6 +132,17 @@ RenewOffers.args = {
132
132
  selected: false,
133
133
  chargeOnText: 'You will be charged on May 1, 2021',
134
134
  },
135
+ {
136
+ title: 'Annual',
137
+ subTitle: '(Renews annually unless cancelled)',
138
+ price: '€ 150.00',
139
+ value: 150.0,
140
+ isTrial: false,
141
+ discount: '25%',
142
+ specialOffer: true,
143
+ selected: false,
144
+ chargeOnText: 'You will be charged on May 1, 2021',
145
+ },
135
146
  {
136
147
  title: '12 Month Subscription',
137
148
  price: '€ 300.00',
@@ -185,6 +185,14 @@ function PaymentTerm(_ref) {
185
185
  defaultChecked: true
186
186
  });
187
187
  var createDiscount = function createDiscount() {
188
+ // We need to display a specific text in the discount tile for H2 campaign offers.
189
+ // This is a TEMPORARY hack and will be removed once the campaign is over (Monday, October 28th).
190
+ // A ticket has been raised to deal with the clean-up: https://financialtimes.atlassian.net/browse/ACQ-2970.
191
+ if (option.specialOffer) {
192
+ return /*#__PURE__*/_react["default"].createElement("span", {
193
+ className: "ncf__payment-term__discount"
194
+ }, "Special offer");
195
+ }
188
196
  return option.discount && /*#__PURE__*/_react["default"].createElement("span", {
189
197
  className: "ncf__payment-term__discount"
190
198
  }, option.bestOffer ? 'Best offer' : "Save ".concat(option.discount, " off RRP"));
@@ -306,6 +314,7 @@ PaymentTerm.propTypes = {
306
314
  title: _propTypes["default"].string,
307
315
  subTitle: _propTypes["default"].string,
308
316
  bestOffer: _propTypes["default"].bool,
317
+ specialOffer: _propTypes["default"].bool,
309
318
  chargeOnText: _propTypes["default"].string,
310
319
  fulfilmentOption: _propTypes["default"].string
311
320
  })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "37.2.2",
3
+ "version": "37.3.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": {
@@ -26,25 +26,25 @@
26
26
  "homepage": "https://github.com/Financial-Times/n-conversion-forms#readme",
27
27
  "dependencies": {
28
28
  "@babel/runtime": "^7.23.9",
29
- "@financial-times/n-pricing": "7.1.0",
29
+ "@financial-times/n-pricing": "8.0.0",
30
30
  "classnames": "2.5.1",
31
31
  "fetchres": "1.7.2",
32
32
  "lodash.get": "4.4.2",
33
- "n-common-static-data": "github:Financial-Times/n-common-static-data#v2.4.0"
33
+ "n-common-static-data": "github:Financial-Times/n-common-static-data#v3.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.23.9",
37
37
  "@babel/plugin-transform-runtime": "^7.23.9",
38
38
  "@babel/preset-env": "^7.23.9",
39
39
  "@babel/preset-react": "^7.23.3",
40
- "@dotcom-tool-kit/babel": "3.1.6",
41
- "@dotcom-tool-kit/component": "4.1.3",
42
- "@dotcom-tool-kit/eslint": "3.2.1",
43
- "@dotcom-tool-kit/frontend-app": "3.2.4",
44
- "@dotcom-tool-kit/jest": "3.4.0",
45
- "@dotcom-tool-kit/lint-staged-npm": "3.2.0",
46
- "@dotcom-tool-kit/logger": "3.4.0",
47
- "@dotcom-tool-kit/prettier": "3.2.0",
40
+ "@dotcom-tool-kit/babel": "3.2.1",
41
+ "@dotcom-tool-kit/component": "4.1.5",
42
+ "@dotcom-tool-kit/eslint": "3.2.2",
43
+ "@dotcom-tool-kit/frontend-app": "3.2.6",
44
+ "@dotcom-tool-kit/jest": "3.4.1",
45
+ "@dotcom-tool-kit/lint-staged-npm": "3.2.1",
46
+ "@dotcom-tool-kit/logger": "3.4.1",
47
+ "@dotcom-tool-kit/prettier": "3.2.1",
48
48
  "@financial-times/eslint-config-next": "7.1.0",
49
49
  "@financial-times/jest-browser-resolver": "^1.0.2",
50
50
  "@snyk/protect": "1.1278.0",
@@ -54,7 +54,7 @@
54
54
  "@storybook/react-webpack5": "^7.6.13",
55
55
  "@sucrase/jest-plugin": "^3.0.0",
56
56
  "check-engines": "^1.6.0",
57
- "dotcom-tool-kit": "3.5.0",
57
+ "dotcom-tool-kit": "3.5.2",
58
58
  "enzyme": "^3.11.0",
59
59
  "enzyme-adapter-react-16": "^1.15.7",
60
60
  "eslint-config-prettier": "^9.1.0",
@@ -81,8 +81,11 @@
81
81
  "webpack-cli": "^5.1.4"
82
82
  },
83
83
  "engines": {
84
- "node": "18.x",
85
- "npm": "7.x || 8.x || 9.x"
84
+ "node": "18.x || 20.x || 22.x",
85
+ "npm": "8.x || 9.x || 10.x"
86
+ },
87
+ "volta": {
88
+ "node": "22.7.0"
86
89
  },
87
90
  "lint-staged": {
88
91
  "**/*.{js,jsx,json,scss}": "dotcom-tool-kit format:staged test:staged --"
@@ -109,8 +112,5 @@
109
112
  "@financial-times/o-social-follow": "^1.0.0",
110
113
  "@financial-times/o-stepped-progress": "^4.0.2",
111
114
  "@financial-times/o-typography": "^7.3.1"
112
- },
113
- "volta": {
114
- "node": "18.17.0"
115
115
  }
116
116
  }