@financial-times/dotcom-ui-footer 2.4.0 → 2.6.1

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 CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "dotcom-ui-footer",
3
3
  "dependencies": {
4
- "o-footer": "^7.0.0"
4
+ "o-footer": "9.0.1-bower"
5
5
  },
6
- "main": ["browser.js", "styles.scss"]
6
+ "main": [
7
+ "browser.js",
8
+ "styles.scss"
9
+ ]
7
10
  }
@@ -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.MoreFromFT = exports.FooterContents = exports.SectionTitle = exports.SectionLinks = void 0;
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), item.label));
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, submenu, index }) => {
17
- // On smaller viewports, submenus which span two columns are collapsed behind toggles
18
- const ariaControls = { 'aria-controls': submenu.length === 2 ? `o-footer-section-${index}` : null };
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" }, footerData.map((item, index) => {
25
- // The Next navigation API splits footer links data into "columns"
26
- // <https://github.com/Financial-Times/next-navigation-api/blob/HEAD/server/transforms/footer.js>
27
- const submenu = item.submenu.items;
28
- return (react_1.default.createElement("div", { key: `group-${index}`, className: `o-footer__matrix-group o-footer__matrix-group--${submenu.length}` },
29
- react_1.default.createElement(SectionTitle, { label: item.label, submenu: submenu, index: index }),
30
- react_1.default.createElement(SectionLinks, { submenu: submenu, index: index })));
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" },
@@ -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.4.0",
3
+ "version": "2.6.1",
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.4.0"
24
+ "@financial-times/dotcom-types-navigation": "^2.6.1"
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, submenu, index }: TSectionTitleProps) => {
45
- // On smaller viewports, submenus which span two columns are collapsed behind toggles
46
- const ariaControls = { 'aria-controls': submenu.length === 2 ? `o-footer-section-${index}` : null }
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} submenu={submenu} index={index} />
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 />