@nice-digital/global-nav 5.0.940 → 7.0.930
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 +18 -55
- package/lib/Footer/Footer.js +31 -55
- package/lib/Footer/Legal/Legal.js +76 -71
- package/lib/Footer/Legal/index.js +10 -7
- package/lib/Footer/Pages/Pages.js +34 -54
- package/lib/Footer/Pages/Pages.module.scss +1 -1
- package/lib/Footer/Pages/index.js +10 -7
- package/lib/Footer/Pages/links.json +2 -5
- package/lib/Footer/Services/Services.js +65 -86
- package/lib/Footer/Services/Services.module.scss +1 -1
- package/lib/Footer/Services/index.js +10 -7
- package/lib/Footer/Social/Social.js +46 -57
- package/lib/Footer/Social/index.js +10 -7
- package/lib/Footer/index.js +10 -7
- package/lib/Header/Account/Account.js +87 -109
- package/lib/Header/Account/index.js +10 -7
- package/lib/Header/Account/nice-accounts.js +7 -12
- package/lib/Header/Header.js +345 -171
- package/lib/Header/Header.module.scss +2 -2
- package/lib/Header/Nav/Dropdown/Components/AboutUs.js +216 -105
- 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 +48 -63
- 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 +84 -102
- 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 +54 -90
- 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 +169 -194
- package/lib/Header/Search/Autocomplete/Autocomplete.module.scss +9 -1
- 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 +73 -90
- package/lib/Header/Search/index.js +10 -7
- package/lib/Header/SkipLink/SkipLink.js +24 -62
- 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 +28 -54
- 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 +48 -74
- 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 +68 -65
- package/types.d.ts +1 -0
- package/lib/Header/Account/AccountOld.js +0 -227
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)
|
|
@@ -42,6 +40,7 @@
|
|
|
42
40
|
- [Header props](#header-props)
|
|
43
41
|
- [Header.service](#headerservice)
|
|
44
42
|
- [Header.skipLinkId](#headerskiplinkid)
|
|
43
|
+
- [Header.renderSearchOnly](#headerrendersearchonly)
|
|
45
44
|
- [Header.onNavigating](#headeronnavigating)
|
|
46
45
|
- [Header.onResize](#headeronresize)
|
|
47
46
|
- [Header.onDropdownOpen](#headerondropdownopen)
|
|
@@ -63,7 +62,6 @@
|
|
|
63
62
|
- [CDN](#cdn)
|
|
64
63
|
- [Container IDs](#container-ids)
|
|
65
64
|
- [Overrides](#overrides)
|
|
66
|
-
- [Supporting IE8](#supporting-ie8)
|
|
67
65
|
- [Configuration](#configuration)
|
|
68
66
|
- [service](#service)
|
|
69
67
|
- [header](#header)
|
|
@@ -75,6 +73,7 @@
|
|
|
75
73
|
- [Upgrading to v3](#upgrading-to-v3)
|
|
76
74
|
- [Upgrading to v4](#upgrading-to-v4)
|
|
77
75
|
- [Upgrading to v5](#upgrading-to-v5)
|
|
76
|
+
- [Upgrading to v6](#upgrading-to-v6)
|
|
78
77
|
|
|
79
78
|
<!-- END doctoc -->
|
|
80
79
|
</details>
|
|
@@ -101,24 +100,20 @@ The following non-functional requirements apply:
|
|
|
101
100
|
|
|
102
101
|
- _accessible_: to WCAG 2.0 AA
|
|
103
102
|
- _touch_: optimized for touch with sufficient touch targets
|
|
104
|
-
- _performance_: budget of 50KB total minified and gzipped, with single HTTP request
|
|
105
103
|
- _print_: print styles
|
|
106
104
|
- _security_: tested against OWASP top 10 and pen tested
|
|
107
105
|
- _progressive enhancement_:
|
|
108
106
|
- mobile first
|
|
109
107
|
- non-JS fallback for SSR React apps
|
|
110
|
-
- _browser support_:
|
|
111
|
-
- 'functional' in < IE11
|
|
108
|
+
- _browser support_: IE11+
|
|
112
109
|
|
|
113
110
|
## Stack
|
|
114
111
|
|
|
115
112
|
- [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
113
|
- [SCSS](https://sass-lang.com/documentation/file.SCSS_FOR_SASS_USERS.html) for styles
|
|
118
114
|
- [CSS Modules](https://github.com/css-modules/css-modules) for generated class names
|
|
119
115
|
- [PostCSS](https://postcss.org/) for transforming CSS with plugins:
|
|
120
116
|
- [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
117
|
- and [NICE Digital shared browserslist config](https://github.com/nice-digital/browserslist-config#readme)
|
|
123
118
|
- [Webpack](https://webpack.js.org/) for module bundling
|
|
124
119
|
- [Babel 7](https://babeljs.io/) for ES6/JSX → ES5 transpilation
|
|
@@ -129,7 +124,7 @@ The following non-functional requirements apply:
|
|
|
129
124
|
- [Prettier](https://prettier.io/) for code formatting
|
|
130
125
|
- [Jest](https://jestjs.io/) for JS unit tests and snapshot tests
|
|
131
126
|
- [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)
|
|
127
|
+
- [NICE Icons](https://github.com/nice-digital/nice-icons)
|
|
133
128
|
|
|
134
129
|
### Principles
|
|
135
130
|
|
|
@@ -148,30 +143,6 @@ Consider the following development principles:
|
|
|
148
143
|
- Clear extension points and hooks for integrating into applications
|
|
149
144
|
- To avoid some of the issues from TopHat where there was no consistency
|
|
150
145
|
|
|
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
146
|
### CSS Modules
|
|
176
147
|
|
|
177
148
|
We use SCSS modules for a few reasons:
|
|
@@ -190,7 +161,7 @@ Using SCSS allows us to use mixins, functions and variables from the NICE Design
|
|
|
190
161
|
**TL;DR;** to run the project locally, do the following:
|
|
191
162
|
|
|
192
163
|
- 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
|
|
164
|
+
- run `npm ci` on the command line to install dependencies
|
|
194
165
|
- run `npm start` on the command line
|
|
195
166
|
- navigate to http://localhost:8080/ in a browser.
|
|
196
167
|
|
|
@@ -201,8 +172,6 @@ This compiles the application and spins up a development server. It then watches
|
|
|
201
172
|
|
|
202
173
|
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
174
|
|
|
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
175
|
### Other commands
|
|
207
176
|
|
|
208
177
|
There are various other commands you can run for further things like tests and linting:
|
|
@@ -270,7 +239,6 @@ The following VS Code extensions are **strongly** recommended, but not required:
|
|
|
270
239
|
|
|
271
240
|
- Check you have the right version of Node installed
|
|
272
241
|
- 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
242
|
- Watch out for features of React that Nerv doesn't support, for example refs.
|
|
275
243
|
|
|
276
244
|
## How to use
|
|
@@ -361,6 +329,13 @@ See [services.json](src/services.json) for a list of the available service ident
|
|
|
361
329
|
The identifier of the skip link target.
|
|
362
330
|
An empty div with this id will be created at the end of the header, if it doesn't already exist on the page.
|
|
363
331
|
|
|
332
|
+
###### Header.renderSearchOnly
|
|
333
|
+
|
|
334
|
+
- Type: `boolean`
|
|
335
|
+
- Default: `false`
|
|
336
|
+
|
|
337
|
+
Optionally render the header with search box only to aid with debugging by reducing noise in the rendered output.
|
|
338
|
+
|
|
364
339
|
###### Header.onNavigating
|
|
365
340
|
|
|
366
341
|
- Type: `String | Function`
|
|
@@ -383,7 +358,7 @@ window.onNavigatingHandler = function (e) {
|
|
|
383
358
|
|
|
384
359
|
if (e.href === '/#browse') {
|
|
385
360
|
// Trigger some custom behaviour
|
|
386
|
-
} else window.location.
|
|
361
|
+
} else window.location.assign(e.href); // Fallback to navigation as normal
|
|
387
362
|
};
|
|
388
363
|
|
|
389
364
|
var global_nav_config = {
|
|
@@ -466,7 +441,6 @@ var global_nav_config = {
|
|
|
466
441
|
},
|
|
467
442
|
};
|
|
468
443
|
```
|
|
469
|
-
|
|
470
444
|
###### Header.additionalSubMenuItems
|
|
471
445
|
|
|
472
446
|
- Type: `null | Array`
|
|
@@ -607,7 +581,7 @@ Pass either a function, or the name of a function defined on `window`. E.g.:
|
|
|
607
581
|
```js
|
|
608
582
|
window.onSearchingHandler = function (e) {
|
|
609
583
|
// Define your implementation here e.g.:
|
|
610
|
-
window.location.
|
|
584
|
+
window.location.assign('/search?q=' + encodeURIComponent(e.query));
|
|
611
585
|
};
|
|
612
586
|
|
|
613
587
|
var global_nav_config = {
|
|
@@ -718,8 +692,6 @@ or
|
|
|
718
692
|
|
|
719
693
|
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
694
|
|
|
721
|
-
> See the [IE8](#supporting-ie8) section below if you're supporting IE8.
|
|
722
|
-
|
|
723
695
|
#### Container IDs
|
|
724
696
|
|
|
725
697
|
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 +730,6 @@ Try not to override Global Nav styles in your app: the Global Nav exists to give
|
|
|
758
730
|
}
|
|
759
731
|
```
|
|
760
732
|
|
|
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
733
|
#### Configuration
|
|
775
734
|
|
|
776
735
|
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 +846,7 @@ V4 involved updating a lot of dependencies. Mostly this was internal implementat
|
|
|
887
846
|
## Upgrading to v5
|
|
888
847
|
|
|
889
848
|
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.
|
|
849
|
+
|
|
850
|
+
## Upgrading to v6
|
|
851
|
+
|
|
852
|
+
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,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _Logo = _interopRequireDefault(require("@nice-digital/icons/lib/Logo"));
|
|
15
|
-
|
|
16
11
|
var _Social = _interopRequireDefault(require("./Social"));
|
|
17
|
-
|
|
18
12
|
var _Legal = _interopRequireDefault(require("./Legal"));
|
|
19
|
-
|
|
20
13
|
var _Services = _interopRequireDefault(require("./Services"));
|
|
21
|
-
|
|
22
14
|
var _Pages = _interopRequireDefault(require("./Pages"));
|
|
23
|
-
|
|
24
15
|
var _FooterModule = _interopRequireDefault(require("./Footer.module.scss"));
|
|
25
|
-
|
|
26
16
|
var _TrackedLink = _interopRequireDefault(require("../TrackedLink"));
|
|
27
|
-
|
|
28
17
|
var _tracker = require("../tracker");
|
|
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
|
-
className: _FooterModule["default"].logo,
|
|
54
|
-
"aria-label": "Go to NICE home page"
|
|
55
|
-
}, /*#__PURE__*/_react["default"].createElement(_Logo["default"], null)), /*#__PURE__*/_react["default"].createElement(_Services["default"], {
|
|
56
|
-
service: this.props.service
|
|
57
|
-
}), /*#__PURE__*/_react["default"].createElement(_Pages["default"], {
|
|
58
|
-
service: this.props.service
|
|
59
|
-
}), /*#__PURE__*/_react["default"].createElement(_Social["default"], null)), /*#__PURE__*/_react["default"].createElement(_Legal["default"], null));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return Footer;
|
|
63
|
-
}(_react.Component);
|
|
64
|
-
|
|
65
|
-
exports.Footer = Footer;
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
//TODO add string type for service prop
|
|
20
|
+
var Footer = function Footer(_ref) {
|
|
21
|
+
var service = _ref.service;
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("footer", {
|
|
23
|
+
className: _FooterModule.default.footer,
|
|
24
|
+
"data-tracking": "Global footer",
|
|
25
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
26
|
+
className: _FooterModule.default.container,
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
28
|
+
eventAction: _tracker.footerClickEventAction,
|
|
29
|
+
eventLabel: "Logo",
|
|
30
|
+
href: "https://www.nice.org.uk/",
|
|
31
|
+
className: _FooterModule.default.logo,
|
|
32
|
+
"aria-label": "Go to NICE home page",
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Logo.default, {})
|
|
34
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Services.default, {
|
|
35
|
+
service: service
|
|
36
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pages.default, {
|
|
37
|
+
service: service
|
|
38
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Social.default, {})]
|
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Legal.default, {})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
66
42
|
Footer.propTypes = {
|
|
67
|
-
service: _propTypes
|
|
43
|
+
service: _propTypes.default.string
|
|
68
44
|
};
|
|
69
45
|
var _default = Footer;
|
|
70
|
-
exports
|
|
46
|
+
exports.default = _default;
|
|
@@ -1,77 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
9
|
var _LegalModule = _interopRequireDefault(require("./Legal.module.scss"));
|
|
13
|
-
|
|
14
10
|
var _TrackedLink = _interopRequireDefault(require("../../TrackedLink"));
|
|
15
|
-
|
|
16
11
|
var _tracker = require("../../tracker");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
var Legal = function Legal() {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
15
|
+
className: _LegalModule.default.wrapper,
|
|
16
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
17
|
+
className: _LegalModule.default.container,
|
|
18
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
19
|
+
className: _LegalModule.default.menu,
|
|
20
|
+
"aria-label": "Legal menu",
|
|
21
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
24
|
+
href: "https://www.nice.org.uk/accessibility",
|
|
25
|
+
eventAction: _tracker.footerClickEventAction,
|
|
26
|
+
eventLabel: "Accessibility",
|
|
27
|
+
children: "Accessibility"
|
|
28
|
+
})
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
31
|
+
href: "https://www.nice.org.uk/freedom-of-information",
|
|
32
|
+
eventAction: _tracker.footerClickEventAction,
|
|
33
|
+
eventLabel: "Freedom of information",
|
|
34
|
+
children: "Freedom of information"
|
|
35
|
+
})
|
|
36
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
38
|
+
href: "https://www.nice.org.uk/glossary",
|
|
39
|
+
eventAction: _tracker.footerClickEventAction,
|
|
40
|
+
eventLabel: "Glossary",
|
|
41
|
+
children: "Glossary"
|
|
42
|
+
})
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
45
|
+
href: "https://www.nice.org.uk/terms-and-conditions",
|
|
46
|
+
eventAction: _tracker.footerClickEventAction,
|
|
47
|
+
eventLabel: "Terms and conditions",
|
|
48
|
+
children: "Terms and conditions"
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
52
|
+
href: "https://www.nice.org.uk/privacy-notice",
|
|
53
|
+
eventAction: _tracker.footerClickEventAction,
|
|
54
|
+
eventLabel: "Privacy notice",
|
|
55
|
+
children: "Privacy notice"
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
59
|
+
href: "https://www.nice.org.uk/cookies",
|
|
60
|
+
eventAction: _tracker.footerClickEventAction,
|
|
61
|
+
eventLabel: "Cookies",
|
|
62
|
+
children: "Cookies"
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
67
|
+
className: _LegalModule.default.copyright,
|
|
68
|
+
children: ["\xA9", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("abbr", {
|
|
69
|
+
title: "National Institute for Health and Care Excellence",
|
|
70
|
+
children: "NICE"
|
|
71
|
+
}), " ", new Date().getFullYear(), ". All rights reserved. Subject to", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
72
|
+
href: "https://www.nice.org.uk/terms-and-conditions#notice-of-rights",
|
|
73
|
+
eventAction: _tracker.footerClickEventAction,
|
|
74
|
+
eventLabel: "Notice of rights",
|
|
75
|
+
children: "Notice of rights"
|
|
76
|
+
}), "."]
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var _default = Legal;
|
|
82
|
+
exports.default = _default;
|
|
@@ -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,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _PagesModule = _interopRequireDefault(require("./Pages.module.scss"));
|
|
15
|
-
|
|
16
11
|
var _links = _interopRequireDefault(require("./links.json"));
|
|
17
|
-
|
|
18
12
|
var _TrackedLink = _interopRequireDefault(require("../../TrackedLink"));
|
|
19
|
-
|
|
20
13
|
var _tracker = require("../../tracker");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
48
|
-
key: link.text
|
|
49
|
-
}, /*#__PURE__*/_react["default"].createElement(_TrackedLink["default"], {
|
|
50
|
-
href: href,
|
|
51
|
-
eventAction: _tracker.footerClickEventAction,
|
|
52
|
-
eventLabel: link.text
|
|
53
|
-
}, link.text));
|
|
54
|
-
}.bind(this))));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return Pages;
|
|
58
|
-
}(_react.Component);
|
|
59
|
-
|
|
60
|
-
exports["default"] = Pages;
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
//TODO add string type for service prop
|
|
16
|
+
var Pages = function Pages(_ref) {
|
|
17
|
+
var service = _ref.service;
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
19
|
+
className: _PagesModule.default.wrapper,
|
|
20
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
21
|
+
className: _PagesModule.default.list,
|
|
22
|
+
children: _links.default.map(function (link) {
|
|
23
|
+
var href = link.href;
|
|
24
|
+
if (link.hrefOverrides && service) {
|
|
25
|
+
href = link.hrefOverrides[service] || href;
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrackedLink.default, {
|
|
29
|
+
href: href,
|
|
30
|
+
eventAction: _tracker.footerClickEventAction,
|
|
31
|
+
eventLabel: link.text,
|
|
32
|
+
children: link.text
|
|
33
|
+
})
|
|
34
|
+
}, link.text);
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
61
39
|
Pages.propTypes = {
|
|
62
|
-
service: _propTypes
|
|
63
|
-
};
|
|
40
|
+
service: _propTypes.default.string
|
|
41
|
+
};
|
|
42
|
+
var _default = Pages;
|
|
43
|
+
exports.default = _default;
|
|
@@ -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 _Pages.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _Pages = _interopRequireDefault(require("./Pages"));
|
|
@@ -28,10 +28,7 @@
|
|
|
28
28
|
"text": "Contact us"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
"href": "https://www.nice.org.uk/leave-feedback",
|
|
32
|
-
"hrefOverrides": {
|
|
33
|
-
"pathways": "https://www.nice.org.uk/NICE-Pathways-feedback"
|
|
34
|
-
},
|
|
31
|
+
"href": "https://www.nice.org.uk/forms/leave-feedback",
|
|
35
32
|
"text": "Leave feedback"
|
|
36
33
|
},
|
|
37
34
|
{
|
|
@@ -39,7 +36,7 @@
|
|
|
39
36
|
"text": "Reusing our content"
|
|
40
37
|
},
|
|
41
38
|
{
|
|
42
|
-
"href": "https://www.nice.org.uk/
|
|
39
|
+
"href": "https://www.nice.org.uk/forms/use-of-nice-content-in-the-uk",
|
|
43
40
|
"text": "NICE UK Open Content Licence"
|
|
44
41
|
},
|
|
45
42
|
{
|