@nice-digital/global-nav 5.0.928 → 7.0.934-GN-76-DropIE11AndUpd
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/README.md +10 -54
- package/lib/Footer/Footer.js +44 -47
- package/lib/Footer/Legal/Legal.js +90 -64
- package/lib/Footer/Legal/index.js +10 -7
- package/lib/Footer/Pages/Pages.js +45 -46
- package/lib/Footer/Pages/Pages.module.scss +1 -1
- package/lib/Footer/Pages/index.js +10 -7
- package/lib/Footer/Services/Services.js +77 -79
- package/lib/Footer/Services/Services.module.scss +1 -1
- package/lib/Footer/Services/index.js +10 -7
- package/lib/Footer/Social/Social.js +67 -55
- package/lib/Footer/Social/index.js +10 -7
- package/lib/Footer/index.js +10 -7
- package/lib/Header/Account/Account.js +83 -104
- package/lib/Header/Account/AccountOld.js +178 -180
- package/lib/Header/Account/index.js +10 -7
- package/lib/Header/Account/nice-accounts.js +7 -12
- package/lib/Header/Header.js +178 -171
- package/lib/Header/Header.module.scss +2 -2
- package/lib/Header/Nav/Dropdown/Components/AboutUs.js +223 -107
- package/lib/Header/Nav/Dropdown/Components/BNF.js +120 -75
- package/lib/Header/Nav/Dropdown/Components/BNFc.js +115 -73
- package/lib/Header/Nav/Dropdown/Components/Button.js +11 -14
- package/lib/Header/Nav/Dropdown/Components/CKS.js +115 -73
- package/lib/Header/Nav/Dropdown/Components/Grid.js +16 -22
- package/lib/Header/Nav/Dropdown/Components/Guidance.js +244 -128
- package/lib/Header/Nav/Dropdown/Components/LifeSciences.js +169 -108
- package/lib/Header/Nav/Dropdown/Components/StandardsAndIndicators.js +83 -45
- package/lib/Header/Nav/Dropdown/Components/index.js +46 -24
- package/lib/Header/Nav/Dropdown/Dropdown.js +46 -61
- package/lib/Header/Nav/Dropdown/Dropdown.module.scss +1 -1
- package/lib/Header/Nav/Dropdown/index.js +10 -7
- package/lib/Header/Nav/Nav.js +71 -92
- package/lib/Header/Nav/Nav.module.scss +2 -4
- package/lib/Header/Nav/NavLinks/NavLinks.js +118 -137
- package/lib/Header/Nav/NavLinks/NavLinks.module.scss +1 -1
- package/lib/Header/Nav/NavLinks/index.js +10 -7
- package/lib/Header/Nav/SubNav/SubNav.js +81 -88
- package/lib/Header/Nav/SubNav/index.js +10 -7
- package/lib/Header/Nav/__mocks__/services.json +3 -3
- package/lib/Header/Nav/index.js +10 -7
- package/lib/Header/OldIEMessage/OldIEMessage.js +65 -67
- package/lib/Header/OldIEMessage/ie.js +14 -0
- package/lib/Header/OldIEMessage/index.js +10 -7
- package/lib/Header/Search/Autocomplete/Autocomplete.js +173 -191
- package/lib/Header/Search/Autocomplete/Autocomplete.module.scss +12 -0
- package/lib/Header/Search/Autocomplete/index.js +10 -7
- package/lib/Header/Search/Autocomplete/suggester/index.js +21 -28
- package/lib/Header/Search/Autocomplete/suggester/phrase-finder.js +13 -14
- package/lib/Header/Search/Autocomplete/suggester/term-finder.js +18 -21
- package/lib/Header/Search/Autocomplete/suggester/tokenizer.js +12 -17
- package/lib/Header/Search/Search.js +60 -81
- package/lib/Header/Search/index.js +10 -7
- package/lib/Header/SkipLink/SkipLink.js +44 -57
- package/lib/Header/SkipLink/SkipLink.module.scss +5 -1
- package/lib/Header/SkipLink/index.js +10 -7
- package/lib/Header/_header-settings.scss +0 -2
- package/lib/Header/context/HeaderContext.js +31 -57
- package/lib/Header/index.js +10 -7
- package/lib/Main/BackToTop/BackToTop.js +22 -25
- package/lib/Main/BackToTop/BackToTop.module.scss +1 -4
- package/lib/Main/Main.js +22 -26
- package/lib/Main/index.js +10 -7
- package/lib/TrackedLink/TrackedLink.js +57 -57
- package/lib/TrackedLink/index.js +10 -7
- package/lib/hooks/useEscapeKeydown.js +8 -21
- package/lib/hooks/useIsClient.js +20 -0
- package/lib/index.js +22 -12
- package/lib/renderer.js +21 -30
- package/lib/tracker/index.js +8 -25
- package/lib/utils.js +4 -7
- package/package.json +66 -64
package/README.md
CHANGED
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
- [Non-functional](#non-functional)
|
|
20
20
|
- [Stack](#stack)
|
|
21
21
|
- [Principles](#principles)
|
|
22
|
-
- [Why Nerv?](#why-nerv)
|
|
23
|
-
- [Why not Preact?](#why-not-preact)
|
|
24
22
|
- [CSS Modules](#css-modules)
|
|
25
23
|
- [:rocket: Set up](#rocket-set-up)
|
|
26
24
|
- [Other commands](#other-commands)
|
|
@@ -63,7 +61,6 @@
|
|
|
63
61
|
- [CDN](#cdn)
|
|
64
62
|
- [Container IDs](#container-ids)
|
|
65
63
|
- [Overrides](#overrides)
|
|
66
|
-
- [Supporting IE8](#supporting-ie8)
|
|
67
64
|
- [Configuration](#configuration)
|
|
68
65
|
- [service](#service)
|
|
69
66
|
- [header](#header)
|
|
@@ -75,6 +72,7 @@
|
|
|
75
72
|
- [Upgrading to v3](#upgrading-to-v3)
|
|
76
73
|
- [Upgrading to v4](#upgrading-to-v4)
|
|
77
74
|
- [Upgrading to v5](#upgrading-to-v5)
|
|
75
|
+
- [Upgrading to v6](#upgrading-to-v6)
|
|
78
76
|
|
|
79
77
|
<!-- END doctoc -->
|
|
80
78
|
</details>
|
|
@@ -101,24 +99,20 @@ The following non-functional requirements apply:
|
|
|
101
99
|
|
|
102
100
|
- _accessible_: to WCAG 2.0 AA
|
|
103
101
|
- _touch_: optimized for touch with sufficient touch targets
|
|
104
|
-
- _performance_: budget of 50KB total minified and gzipped, with single HTTP request
|
|
105
102
|
- _print_: print styles
|
|
106
103
|
- _security_: tested against OWASP top 10 and pen tested
|
|
107
104
|
- _progressive enhancement_:
|
|
108
105
|
- mobile first
|
|
109
106
|
- non-JS fallback for SSR React apps
|
|
110
|
-
- _browser support_:
|
|
111
|
-
- 'functional' in < IE11
|
|
107
|
+
- _browser support_: IE11+
|
|
112
108
|
|
|
113
109
|
## Stack
|
|
114
110
|
|
|
115
111
|
- [React](https://reactjs.org/)
|
|
116
|
-
- [NervJS](https://github.com/NervJS/nerv) for smaller footprint and IE8 support, until we drop support for IE8, then we can consider Preact
|
|
117
112
|
- [SCSS](https://sass-lang.com/documentation/file.SCSS_FOR_SASS_USERS.html) for styles
|
|
118
113
|
- [CSS Modules](https://github.com/css-modules/css-modules) for generated class names
|
|
119
114
|
- [PostCSS](https://postcss.org/) for transforming CSS with plugins:
|
|
120
115
|
- [autoprefixer](https://autoprefixer.github.io/) for automatically adding vendor prefixes in CSS
|
|
121
|
-
- [pixrem](https://github.com/robwierzbowski/node-pixrem) for adding pixel fallbacks to rem values to support IE8+
|
|
122
116
|
- and [NICE Digital shared browserslist config](https://github.com/nice-digital/browserslist-config#readme)
|
|
123
117
|
- [Webpack](https://webpack.js.org/) for module bundling
|
|
124
118
|
- [Babel 7](https://babeljs.io/) for ES6/JSX → ES5 transpilation
|
|
@@ -129,7 +123,7 @@ The following non-functional requirements apply:
|
|
|
129
123
|
- [Prettier](https://prettier.io/) for code formatting
|
|
130
124
|
- [Jest](https://jestjs.io/) for JS unit tests and snapshot tests
|
|
131
125
|
- [NICE Design System](https://nice-digital.github.io/nice-design-system/) core for SASS mixins, functions and colour/spacing variables
|
|
132
|
-
- [NICE Icons](https://github.com/nice-digital/nice-icons)
|
|
126
|
+
- [NICE Icons](https://github.com/nice-digital/nice-icons)
|
|
133
127
|
|
|
134
128
|
### Principles
|
|
135
129
|
|
|
@@ -148,30 +142,6 @@ Consider the following development principles:
|
|
|
148
142
|
- Clear extension points and hooks for integrating into applications
|
|
149
143
|
- To avoid some of the issues from TopHat where there was no consistency
|
|
150
144
|
|
|
151
|
-
### Why Nerv?
|
|
152
|
-
|
|
153
|
-
You've probably never heard of [Nerv](https://nerv.aotu.io/). So why use it?
|
|
154
|
-
|
|
155
|
-
We are using React because:
|
|
156
|
-
|
|
157
|
-
- it gives us structure to our app
|
|
158
|
-
- is well used in the community
|
|
159
|
-
- is easy to test
|
|
160
|
-
- is being adopted across Digital Services.
|
|
161
|
-
|
|
162
|
-
However, consider the [non-functional requirements](#non-functional) and [development principles](#principles) above - specifically the need to support IE8 and to have a small bundle size. React works in IE9+ (with Polyfills) and is 31.8K (React 16.2.0 + React DOM minified and gzipped). Both of these make it less than ideal for creating a standalone bundle that will load on every page across NICE alongside each application's code.
|
|
163
|
-
|
|
164
|
-
This is where Nerv fits in. It's a "blazing fast React alternative, compatible with IE8 and React 16" and is one third of React's size. It's a drop in replacement (via [aliases in Webpack](https://github.com/NervJS/nerv#usage-with-webpack)) so allows us to write 'normal' React, but compile with Nerv.
|
|
165
|
-
|
|
166
|
-
#### Why not Preact?
|
|
167
|
-
|
|
168
|
-
We considered [Preact](https://preactjs.com/) as a React alternative as it's only 3kB. However, we discounted it at the time of writing because:
|
|
169
|
-
|
|
170
|
-
- it didn't have full support for React 16
|
|
171
|
-
- the [browser support](https://preactjs.com/about/browser-support) docs were vague on detail for supporting IE8 and we struggled to get it to work.
|
|
172
|
-
|
|
173
|
-
We may consider replacing Nerv with Preact in the future if we drop support for IE8.
|
|
174
|
-
|
|
175
145
|
### CSS Modules
|
|
176
146
|
|
|
177
147
|
We use SCSS modules for a few reasons:
|
|
@@ -190,7 +160,7 @@ Using SCSS allows us to use mixins, functions and variables from the NICE Design
|
|
|
190
160
|
**TL;DR;** to run the project locally, do the following:
|
|
191
161
|
|
|
192
162
|
- install [Node 14+](https://nodejs.org/en/download/) or latest LTS version. Or even better, use [Volta](https://volta.sh/) to use the Node version pinned in package.json.
|
|
193
|
-
- run `npm
|
|
163
|
+
- run `npm ci` on the command line to install dependencies
|
|
194
164
|
- run `npm start` on the command line
|
|
195
165
|
- navigate to http://localhost:8080/ in a browser.
|
|
196
166
|
|
|
@@ -201,8 +171,6 @@ This compiles the application and spins up a development server. It then watches
|
|
|
201
171
|
|
|
202
172
|
It then automatically reloads the application in the Browser (so no need for a manual reload) using [Hot Module Replacement (HMR) in webpack](https://webpack.js.org/concepts/hot-module-replacement/).
|
|
203
173
|
|
|
204
|
-
> Note HMR doesn't work in IE8. Run the app via `npm run start:nohot` to test in IE8. You'll then to reload manually.
|
|
205
|
-
|
|
206
174
|
### Other commands
|
|
207
175
|
|
|
208
176
|
There are various other commands you can run for further things like tests and linting:
|
|
@@ -270,7 +238,6 @@ The following VS Code extensions are **strongly** recommended, but not required:
|
|
|
270
238
|
|
|
271
239
|
- Check you have the right version of Node installed
|
|
272
240
|
- Make sure have LF line endings as this is a cross-platform project. This _should_ happen automatically because of settings in _.gitattributes_ and _.editorconfig_.
|
|
273
|
-
- Use normal functions, rather than arrow functions because of support for IE8
|
|
274
241
|
- Watch out for features of React that Nerv doesn't support, for example refs.
|
|
275
242
|
|
|
276
243
|
## How to use
|
|
@@ -383,7 +350,7 @@ window.onNavigatingHandler = function (e) {
|
|
|
383
350
|
|
|
384
351
|
if (e.href === '/#browse') {
|
|
385
352
|
// Trigger some custom behaviour
|
|
386
|
-
} else window.location.
|
|
353
|
+
} else window.location.assign(e.href); // Fallback to navigation as normal
|
|
387
354
|
};
|
|
388
355
|
|
|
389
356
|
var global_nav_config = {
|
|
@@ -607,7 +574,7 @@ Pass either a function, or the name of a function defined on `window`. E.g.:
|
|
|
607
574
|
```js
|
|
608
575
|
window.onSearchingHandler = function (e) {
|
|
609
576
|
// Define your implementation here e.g.:
|
|
610
|
-
window.location.
|
|
577
|
+
window.location.assign('/search?q=' + encodeURIComponent(e.query));
|
|
611
578
|
};
|
|
612
579
|
|
|
613
580
|
var global_nav_config = {
|
|
@@ -718,8 +685,6 @@ or
|
|
|
718
685
|
|
|
719
686
|
Note the production build needs the `+` character in the build metadata encoding as `%2B` to avoid browsers interpreting it as a space in the URL.
|
|
720
687
|
|
|
721
|
-
> See the [IE8](#supporting-ie8) section below if you're supporting IE8.
|
|
722
|
-
|
|
723
688
|
#### Container IDs
|
|
724
689
|
|
|
725
690
|
The CDN version of Global Nav creates its own containers for the header and footer if they don't already exist on the page. These containers use the ids:
|
|
@@ -758,19 +723,6 @@ Try not to override Global Nav styles in your app: the Global Nav exists to give
|
|
|
758
723
|
}
|
|
759
724
|
```
|
|
760
725
|
|
|
761
|
-
#### Supporting IE8
|
|
762
|
-
|
|
763
|
-
Include the Global Nav polyfills before Global Nav itself to support IE8, for example:
|
|
764
|
-
|
|
765
|
-
```js
|
|
766
|
-
<!--[if lt IE 9]>
|
|
767
|
-
<script src="//cdn.nice.org.uk/global-nav/global-nav.ie8.min.js"></script>
|
|
768
|
-
<![endif]-->
|
|
769
|
-
<script src="//cdn.nice.org.uk/global-nav/global-nav.min.js"></script>
|
|
770
|
-
```
|
|
771
|
-
|
|
772
|
-
> Note: if you're supporting IE8 then you'll also need to include [html5shiv](https://github.com/aFarkas/html5shiv) in the `head` because we use HTML5 semantic elements like `header` and `footer`.
|
|
773
|
-
|
|
774
726
|
#### Configuration
|
|
775
727
|
|
|
776
728
|
Global Nav configuration is loaded from a global JavaScript variable on the window object called `global_nav_config`. Include this variable before the [cdn script include](#cdn). Here's a fulle example of all the available config options:
|
|
@@ -887,3 +839,7 @@ V4 involved updating a lot of dependencies. Mostly this was internal implementat
|
|
|
887
839
|
## Upgrading to v5
|
|
888
840
|
|
|
889
841
|
Version 5 includes updates for the summer 2022 brand refresh. It's mostly an internal refactor of typography and colour updates and shouldn't include any breaking API changes.
|
|
842
|
+
|
|
843
|
+
## Upgrading to v6
|
|
844
|
+
|
|
845
|
+
Version 6 is mostly updates of dependencies, the biggest of which was React Testing Library (from Enzyme). It also includes support for React 18 and Design System v5.
|
package/lib/Footer/Footer.js
CHANGED
|
@@ -1,70 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.Footer = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
10
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
16
|
var _Logo = _interopRequireDefault(require("@nice-digital/icons/lib/Logo"));
|
|
15
|
-
|
|
16
17
|
var _Social = _interopRequireDefault(require("./Social"));
|
|
17
|
-
|
|
18
18
|
var _Legal = _interopRequireDefault(require("./Legal"));
|
|
19
|
-
|
|
20
19
|
var _Services = _interopRequireDefault(require("./Services"));
|
|
21
|
-
|
|
22
20
|
var _Pages = _interopRequireDefault(require("./Pages"));
|
|
23
|
-
|
|
24
21
|
var _FooterModule = _interopRequireDefault(require("./Footer.module.scss"));
|
|
25
|
-
|
|
26
22
|
var _TrackedLink = _interopRequireDefault(require("../TrackedLink"));
|
|
27
|
-
|
|
28
23
|
var _tracker = require("../tracker");
|
|
29
|
-
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
29
|
var Footer = /*#__PURE__*/function (_Component) {
|
|
35
|
-
(0,
|
|
36
|
-
|
|
30
|
+
(0, _inherits2.default)(Footer, _Component);
|
|
31
|
+
var _super = _createSuper(Footer);
|
|
37
32
|
function Footer() {
|
|
38
|
-
|
|
33
|
+
(0, _classCallCheck2.default)(this, Footer);
|
|
34
|
+
return _super.apply(this, arguments);
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
36
|
+
(0, _createClass2.default)(Footer, [{
|
|
37
|
+
key: "render",
|
|
38
|
+
value: function render() {
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("footer", {
|
|
40
|
+
className: _FooterModule.default.footer,
|
|
41
|
+
"data-tracking": "Global footer",
|
|
42
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
43
|
+
className: _FooterModule.default.container,
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
45
|
+
eventAction: _tracker.footerClickEventAction,
|
|
46
|
+
eventLabel: "Logo",
|
|
47
|
+
href: "https://www.nice.org.uk/",
|
|
48
|
+
className: _FooterModule.default.logo,
|
|
49
|
+
"aria-label": "Go to NICE home page",
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Logo.default, {})
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Services.default, {
|
|
52
|
+
service: this.props.service
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pages.default, {
|
|
54
|
+
service: this.props.service
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Social.default, {})]
|
|
56
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Legal.default, {})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}]);
|
|
62
60
|
return Footer;
|
|
63
61
|
}(_react.Component);
|
|
64
|
-
|
|
65
62
|
exports.Footer = Footer;
|
|
66
63
|
Footer.propTypes = {
|
|
67
|
-
service: _propTypes
|
|
64
|
+
service: _propTypes.default.string
|
|
68
65
|
};
|
|
69
66
|
var _default = Footer;
|
|
70
|
-
exports
|
|
67
|
+
exports.default = _default;
|
|
@@ -1,77 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
10
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
15
|
var _LegalModule = _interopRequireDefault(require("./Legal.module.scss"));
|
|
13
|
-
|
|
14
16
|
var _TrackedLink = _interopRequireDefault(require("../../TrackedLink"));
|
|
15
|
-
|
|
16
17
|
var _tracker = require("../../tracker");
|
|
17
|
-
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
23
|
var Legal = /*#__PURE__*/function (_Component) {
|
|
23
|
-
(0,
|
|
24
|
-
|
|
24
|
+
(0, _inherits2.default)(Legal, _Component);
|
|
25
|
+
var _super = _createSuper(Legal);
|
|
25
26
|
function Legal() {
|
|
26
|
-
|
|
27
|
+
(0, _classCallCheck2.default)(this, Legal);
|
|
28
|
+
return _super.apply(this, arguments);
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
30
|
+
(0, _createClass2.default)(Legal, [{
|
|
31
|
+
key: "render",
|
|
32
|
+
value: function render() {
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
34
|
+
className: _LegalModule.default.wrapper,
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
36
|
+
className: _LegalModule.default.container,
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
38
|
+
className: _LegalModule.default.menu,
|
|
39
|
+
"aria-label": "Legal menu",
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
43
|
+
href: "https://www.nice.org.uk/accessibility",
|
|
44
|
+
eventAction: _tracker.footerClickEventAction,
|
|
45
|
+
eventLabel: "Accessibility",
|
|
46
|
+
children: "Accessibility"
|
|
47
|
+
})
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
49
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
50
|
+
href: "https://www.nice.org.uk/freedom-of-information",
|
|
51
|
+
eventAction: _tracker.footerClickEventAction,
|
|
52
|
+
eventLabel: "Freedom of information",
|
|
53
|
+
children: "Freedom of information"
|
|
54
|
+
})
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
57
|
+
href: "https://www.nice.org.uk/glossary",
|
|
58
|
+
eventAction: _tracker.footerClickEventAction,
|
|
59
|
+
eventLabel: "Glossary",
|
|
60
|
+
children: "Glossary"
|
|
61
|
+
})
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
64
|
+
href: "https://www.nice.org.uk/terms-and-conditions",
|
|
65
|
+
eventAction: _tracker.footerClickEventAction,
|
|
66
|
+
eventLabel: "Terms and conditions",
|
|
67
|
+
children: "Terms and conditions"
|
|
68
|
+
})
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
71
|
+
href: "https://www.nice.org.uk/privacy-notice",
|
|
72
|
+
eventAction: _tracker.footerClickEventAction,
|
|
73
|
+
eventLabel: "Privacy notice",
|
|
74
|
+
children: "Privacy notice"
|
|
75
|
+
})
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
78
|
+
href: "https://www.nice.org.uk/cookies",
|
|
79
|
+
eventAction: _tracker.footerClickEventAction,
|
|
80
|
+
eventLabel: "Cookies",
|
|
81
|
+
children: "Cookies"
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
86
|
+
className: _LegalModule.default.copyright,
|
|
87
|
+
children: ["\xA9", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("abbr", {
|
|
88
|
+
title: "National Institute for Health and Care Excellence",
|
|
89
|
+
children: "NICE"
|
|
90
|
+
}), " ", new Date().getFullYear(), ". All rights reserved. Subject to", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
91
|
+
href: "https://www.nice.org.uk/terms-and-conditions#notice-of-rights",
|
|
92
|
+
eventAction: _tracker.footerClickEventAction,
|
|
93
|
+
eventLabel: "Notice of rights",
|
|
94
|
+
children: "Notice of rights"
|
|
95
|
+
}), "."]
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}]);
|
|
74
101
|
return Legal;
|
|
75
102
|
}(_react.Component);
|
|
76
|
-
|
|
77
|
-
exports["default"] = Legal;
|
|
103
|
+
exports.default = Legal;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _Legal.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _Legal = _interopRequireDefault(require("./Legal"));
|
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
10
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
16
|
var _PagesModule = _interopRequireDefault(require("./Pages.module.scss"));
|
|
15
|
-
|
|
16
17
|
var _links = _interopRequireDefault(require("./links.json"));
|
|
17
|
-
|
|
18
18
|
var _TrackedLink = _interopRequireDefault(require("../../TrackedLink"));
|
|
19
|
-
|
|
20
19
|
var _tracker = require("../../tracker");
|
|
21
|
-
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
24
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
25
|
var Pages = /*#__PURE__*/function (_Component) {
|
|
27
|
-
(0,
|
|
28
|
-
|
|
26
|
+
(0, _inherits2.default)(Pages, _Component);
|
|
27
|
+
var _super = _createSuper(Pages);
|
|
29
28
|
function Pages() {
|
|
30
|
-
|
|
29
|
+
(0, _classCallCheck2.default)(this, Pages);
|
|
30
|
+
return _super.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
(0, _createClass2.default)(Pages, [{
|
|
33
|
+
key: "render",
|
|
34
|
+
value: function render() {
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
36
|
+
className: _PagesModule.default.wrapper,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
38
|
+
className: _PagesModule.default.list,
|
|
39
|
+
children: _links.default.map(function (link) {
|
|
40
|
+
var href = link.href;
|
|
41
|
+
if (link.hrefOverrides && this.props.service) {
|
|
42
|
+
href = link.hrefOverrides[this.props.service] || href;
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
46
|
+
href: href,
|
|
47
|
+
eventAction: _tracker.footerClickEventAction,
|
|
48
|
+
eventLabel: link.text,
|
|
49
|
+
children: link.text
|
|
50
|
+
})
|
|
51
|
+
}, link.text);
|
|
52
|
+
}.bind(this))
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
57
|
return Pages;
|
|
58
58
|
}(_react.Component);
|
|
59
|
-
|
|
60
|
-
exports["default"] = Pages;
|
|
59
|
+
exports.default = Pages;
|
|
61
60
|
Pages.propTypes = {
|
|
62
|
-
service: _propTypes
|
|
61
|
+
service: _propTypes.default.string
|
|
63
62
|
};
|