@financial-times/dotcom-ui-footer 2.5.1 → 2.6.2
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/bower.json +5 -2
- package/dist/node/components/partials.js +19 -16
- package/dist/node/index.js +0 -1
- package/package.json +2 -2
- package/src/components/partials.tsx +16 -27
- package/src/index.tsx +1 -8
package/bower.json
CHANGED
|
@@ -3,36 +3,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NikkeiBrandLogo = exports.CopyrightNotice = exports.CompressedLegal = exports.
|
|
6
|
+
exports.NikkeiBrandLogo = exports.CopyrightNotice = exports.CompressedLegal = exports.FooterContents = exports.SectionTitle = exports.SectionLinks = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Link = ({ item, ...props }) => {
|
|
9
9
|
const disableTracking = { 'data-o-tracking-do-not-track': item.disableTracking ? true : null };
|
|
10
|
-
return (react_1.default.createElement("a", Object.assign({}, props, { href: item.url, "data-trackable": item.label }, disableTracking),
|
|
10
|
+
return (react_1.default.createElement("a", Object.assign({}, props, { href: item.url, "data-trackable": item.label }, disableTracking),
|
|
11
|
+
react_1.default.createElement("span", { className: "o-footer__matrix-link__copy" }, item.label)));
|
|
11
12
|
};
|
|
12
13
|
const SectionLinks = ({ submenu, index }) => {
|
|
13
14
|
return (react_1.default.createElement("div", { className: "o-footer__matrix-content", id: `o-footer-section-${index}` }, submenu.map((submenuItems, index) => (react_1.default.createElement("div", { className: "o-footer__matrix-column", key: `column-${index}` }, submenuItems.map((item, index) => (react_1.default.createElement(Link, { className: "o-footer__matrix-link", item: item, key: `link-${index}` }))))))));
|
|
14
15
|
};
|
|
15
16
|
exports.SectionLinks = SectionLinks;
|
|
16
|
-
const SectionTitle = ({ label,
|
|
17
|
-
// On smaller viewports,
|
|
18
|
-
const ariaControls = { 'aria-controls':
|
|
17
|
+
const SectionTitle = ({ label, index }) => {
|
|
18
|
+
// On smaller viewports, submenu which span one column is collapsed behind toggles
|
|
19
|
+
const ariaControls = { 'aria-controls': `o-footer-section-${index}` };
|
|
19
20
|
return (react_1.default.createElement("h3", Object.assign({ className: "o-footer__matrix-title" }, ariaControls), label));
|
|
20
21
|
};
|
|
21
22
|
exports.SectionTitle = SectionTitle;
|
|
22
23
|
const FooterContents = ({ footerData }) => (react_1.default.createElement("div", { className: "o-footer__row" },
|
|
23
24
|
react_1.default.createElement("h2", { className: "o-normalise-visually-hidden" }, "Useful links"),
|
|
24
|
-
react_1.default.createElement("nav", { className: "o-footer__matrix", role: "navigation", "aria-label": "Useful links" },
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
react_1.default.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
react_1.default.createElement("nav", { className: "o-footer__matrix", role: "navigation", "aria-label": "Useful links" },
|
|
26
|
+
footerData.map((item, index) => {
|
|
27
|
+
// The Next navigation API splits footer links data into "columns"
|
|
28
|
+
// <https://github.com/Financial-Times/next-navigation-api/blob/HEAD/server/transforms/footer.js>
|
|
29
|
+
const submenu = item.submenu.items;
|
|
30
|
+
return (react_1.default.createElement("div", { key: `group-${index}`, className: `o-footer__matrix-group o-footer__matrix-group--${submenu.length}` },
|
|
31
|
+
react_1.default.createElement(SectionTitle, { label: item.label, index: index }),
|
|
32
|
+
react_1.default.createElement(SectionLinks, { submenu: submenu, index: index })));
|
|
33
|
+
}),
|
|
34
|
+
react_1.default.createElement("div", { className: "o-footer__matrix-group o-footer__matrix-group--1" },
|
|
35
|
+
react_1.default.createElement("h3", { className: "o-footer__matrix-title o-footer__matrix-title--link" },
|
|
36
|
+
react_1.default.createElement("a", { className: "o-footer__matrix-link o-footer__matrix-link--more", id: `o-footer-${footerData.length}`, href: "https://ft.com/more-from-ft-group" },
|
|
37
|
+
react_1.default.createElement("span", { className: "o-footer__matrix-link__copy" }, "More from the FT Group")))))));
|
|
32
38
|
exports.FooterContents = FooterContents;
|
|
33
|
-
const MoreFromFT = () => (react_1.default.createElement("div", { className: "o-footer__external-link o-footer__matrix-title" },
|
|
34
|
-
react_1.default.createElement("a", { className: "o-footer__more-from-ft o-footer__matrix-title", href: "http://ft.com/more-from-ft-group", "data-trackable": "more-from-ft" }, "More from the FT Group")));
|
|
35
|
-
exports.MoreFromFT = MoreFromFT;
|
|
36
39
|
const CopyrightNotice = ({ withoutMarketsData = false }) => {
|
|
37
40
|
const marketsData = withoutMarketsData ? '' : 'Markets data delayed by at least 15 minutes. ';
|
|
38
41
|
return (react_1.default.createElement("div", { className: "o-footer__copyright" },
|
package/dist/node/index.js
CHANGED
|
@@ -12,7 +12,6 @@ function Footer(props) {
|
|
|
12
12
|
return (react_1.default.createElement("footer", { id: "site-footer", className: `o-footer o-footer--theme-${theme}`, "data-o-component": "o-footer" },
|
|
13
13
|
react_1.default.createElement("div", { className: "o-footer__container" },
|
|
14
14
|
react_1.default.createElement(partials_1.FooterContents, { footerData: footerData }),
|
|
15
|
-
react_1.default.createElement(partials_1.MoreFromFT, null),
|
|
16
15
|
react_1.default.createElement(partials_1.CopyrightNotice, null)),
|
|
17
16
|
react_1.default.createElement(partials_1.NikkeiBrandLogo, null)));
|
|
18
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-footer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "component.js",
|
|
6
6
|
"styles": "styles.scss",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@financial-times/dotcom-types-navigation": "^2.
|
|
24
|
+
"@financial-times/dotcom-types-navigation": "^2.6.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^16.8.6"
|
|
@@ -11,7 +11,7 @@ const Link = ({ item, ...props }: TLinkProps) => {
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<a {...props} href={item.url} data-trackable={item.label} {...disableTracking}>
|
|
14
|
-
{item.label}
|
|
14
|
+
<span className="o-footer__matrix-link__copy">{item.label}</span>
|
|
15
15
|
</a>
|
|
16
16
|
)
|
|
17
17
|
}
|
|
@@ -38,12 +38,11 @@ const SectionLinks = ({ submenu, index }: TSectionLinksProps) => {
|
|
|
38
38
|
type TSectionTitleProps = {
|
|
39
39
|
index: number
|
|
40
40
|
label: string
|
|
41
|
-
submenu: TNavMenuItem[][]
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
const SectionTitle = ({ label,
|
|
45
|
-
// On smaller viewports,
|
|
46
|
-
const ariaControls = { 'aria-controls':
|
|
43
|
+
const SectionTitle = ({ label, index }: TSectionTitleProps) => {
|
|
44
|
+
// On smaller viewports, submenu which span one column is collapsed behind toggles
|
|
45
|
+
const ariaControls = { 'aria-controls': `o-footer-section-${index}` }
|
|
47
46
|
return (
|
|
48
47
|
<h3 className="o-footer__matrix-title" {...ariaControls}>
|
|
49
48
|
{label}
|
|
@@ -63,31 +62,29 @@ const FooterContents = ({ footerData }: TFooterContentsProps) => (
|
|
|
63
62
|
// The Next navigation API splits footer links data into "columns"
|
|
64
63
|
// <https://github.com/Financial-Times/next-navigation-api/blob/HEAD/server/transforms/footer.js>
|
|
65
64
|
const submenu = item.submenu.items as TNavMenuItem[][]
|
|
66
|
-
|
|
67
65
|
return (
|
|
68
66
|
<div
|
|
69
67
|
key={`group-${index}`}
|
|
70
68
|
className={`o-footer__matrix-group o-footer__matrix-group--${submenu.length}`}>
|
|
71
|
-
<SectionTitle label={item.label}
|
|
69
|
+
<SectionTitle label={item.label} index={index} />
|
|
72
70
|
<SectionLinks submenu={submenu} index={index} />
|
|
73
71
|
</div>
|
|
74
72
|
)
|
|
75
73
|
})}
|
|
74
|
+
<div className="o-footer__matrix-group o-footer__matrix-group--1">
|
|
75
|
+
<h3 className="o-footer__matrix-title o-footer__matrix-title--link">
|
|
76
|
+
<a
|
|
77
|
+
className="o-footer__matrix-link o-footer__matrix-link--more"
|
|
78
|
+
id={`o-footer-${footerData.length}`}
|
|
79
|
+
href="https://ft.com/more-from-ft-group">
|
|
80
|
+
<span className="o-footer__matrix-link__copy">More from the FT Group</span>
|
|
81
|
+
</a>
|
|
82
|
+
</h3>
|
|
83
|
+
</div>
|
|
76
84
|
</nav>
|
|
77
85
|
</div>
|
|
78
86
|
)
|
|
79
87
|
|
|
80
|
-
const MoreFromFT = () => (
|
|
81
|
-
<div className="o-footer__external-link o-footer__matrix-title">
|
|
82
|
-
<a
|
|
83
|
-
className="o-footer__more-from-ft o-footer__matrix-title"
|
|
84
|
-
href="http://ft.com/more-from-ft-group"
|
|
85
|
-
data-trackable="more-from-ft">
|
|
86
|
-
More from the FT Group
|
|
87
|
-
</a>
|
|
88
|
-
</div>
|
|
89
|
-
)
|
|
90
|
-
|
|
91
88
|
const CopyrightNotice = ({ withoutMarketsData = false }) => {
|
|
92
89
|
const marketsData = withoutMarketsData ? '' : 'Markets data delayed by at least 15 minutes. '
|
|
93
90
|
return (
|
|
@@ -146,12 +143,4 @@ const NikkeiBrandLogo = () => (
|
|
|
146
143
|
</div>
|
|
147
144
|
)
|
|
148
145
|
|
|
149
|
-
export {
|
|
150
|
-
SectionLinks,
|
|
151
|
-
SectionTitle,
|
|
152
|
-
FooterContents,
|
|
153
|
-
MoreFromFT,
|
|
154
|
-
CompressedLegal,
|
|
155
|
-
CopyrightNotice,
|
|
156
|
-
NikkeiBrandLogo
|
|
157
|
-
}
|
|
146
|
+
export { SectionLinks, SectionTitle, FooterContents, CompressedLegal, CopyrightNotice, NikkeiBrandLogo }
|
package/src/index.tsx
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { TNavigationData } from '@financial-times/dotcom-types-navigation'
|
|
3
|
-
import {
|
|
4
|
-
FooterContents,
|
|
5
|
-
MoreFromFT,
|
|
6
|
-
CopyrightNotice,
|
|
7
|
-
NikkeiBrandLogo,
|
|
8
|
-
CompressedLegal
|
|
9
|
-
} from './components/partials'
|
|
3
|
+
import { FooterContents, CopyrightNotice, NikkeiBrandLogo, CompressedLegal } from './components/partials'
|
|
10
4
|
|
|
11
5
|
export type TFooterOptions = {
|
|
12
6
|
theme?: 'dark' | 'light' | string
|
|
@@ -23,7 +17,6 @@ export function Footer(props: TFooterProps) {
|
|
|
23
17
|
<footer id="site-footer" className={`o-footer o-footer--theme-${theme}`} data-o-component="o-footer">
|
|
24
18
|
<div className="o-footer__container">
|
|
25
19
|
<FooterContents footerData={footerData} />
|
|
26
|
-
<MoreFromFT />
|
|
27
20
|
<CopyrightNotice />
|
|
28
21
|
</div>
|
|
29
22
|
<NikkeiBrandLogo />
|