@ilo-org/react 0.1.2 → 0.2.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.
- package/CHANGELOG.md +14 -0
- package/lib/cjs/components/Footer/Footer.js +23 -0
- package/lib/cjs/components/Footer/index.js +18 -0
- package/lib/cjs/components/LocalNav/LocalNav.js +102 -0
- package/lib/cjs/components/LocalNav/index.js +14 -0
- package/lib/cjs/components/index.js +4 -0
- package/lib/cjs/index.js +4 -0
- package/lib/esm/components/Footer/Footer.js +21 -0
- package/lib/esm/components/Footer/index.js +12 -0
- package/lib/esm/components/LocalNav/LocalNav.js +100 -0
- package/lib/esm/components/LocalNav/index.js +8 -0
- package/lib/esm/components/index.js +2 -0
- package/lib/esm/index.js +2 -0
- package/lib/types/react/src/components/ContextMenu/ContextMenu.props.d.ts +1 -2
- package/lib/types/react/src/components/Footer/Footer.d.ts +4 -0
- package/lib/types/react/src/components/Footer/Footer.props.d.ts +70 -0
- package/lib/types/react/src/components/Footer/index.d.ts +1 -0
- package/lib/types/react/src/components/LinkList/LinkList.props.d.ts +2 -3
- package/lib/types/react/src/components/LocalNav/LocalNav.d.ts +4 -0
- package/lib/types/react/src/components/LocalNav/LocalNav.props.d.ts +50 -0
- package/lib/types/react/src/components/LocalNav/index.d.ts +1 -0
- package/lib/types/react/src/components/index.d.ts +2 -0
- package/lib/types/react/src/types/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/ContextMenu/ContextMenu.props.ts +1 -1
- package/src/components/Footer/Footer.args.ts +105 -0
- package/src/components/Footer/Footer.props.ts +84 -0
- package/src/components/Footer/Footer.tsx +107 -0
- package/src/components/Footer/index.ts +1 -0
- package/src/components/LinkList/LinkList.props.ts +2 -2
- package/src/components/LocalNav/LocalNav.args.ts +64 -0
- package/src/components/LocalNav/LocalNav.props.ts +60 -0
- package/src/components/LocalNav/LocalNav.tsx +175 -0
- package/src/components/LocalNav/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/types/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ilo-org/react
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3a19726f2: Add LocalNav and Footer components
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [2f60e9d92]
|
|
12
|
+
- Updated dependencies [c9413b943]
|
|
13
|
+
- @ilo-org/styles@0.1.18
|
|
14
|
+
- @ilo-org/brand-assets@0.1.0
|
|
15
|
+
- @ilo-org/utils@0.0.11
|
|
16
|
+
|
|
3
17
|
## 0.1.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
5
|
+
var classNames = require('classnames');
|
|
6
|
+
var components_LinkList_LinkList = require('../LinkList/LinkList.js');
|
|
7
|
+
var components_Button_Button = require('../Button/Button.js');
|
|
8
|
+
require('tslib');
|
|
9
|
+
require('react');
|
|
10
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
11
|
+
require('../Link/Link.js');
|
|
12
|
+
require('../Icon/Icon.js');
|
|
13
|
+
require('@ilo-org/icons-react');
|
|
14
|
+
|
|
15
|
+
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup, socials, subscribe, legal, secondarylinks, anchorlink, }) => {
|
|
16
|
+
const { prefix } = hooks_useGlobalSettings();
|
|
17
|
+
const baseClass = `${prefix}--footer`;
|
|
18
|
+
const footerClasses = classNames(className, baseClass);
|
|
19
|
+
return (jsxRuntime.jsxs("footer", Object.assign({ className: footerClasses }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--main` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "site--info" }, { children: [jsxRuntime.jsx("img", { className: `${baseClass}--logo`, src: logo, alt: "ILO Logo" }), jsxRuntime.jsx("h3", Object.assign({ className: `${baseClass}--headline` }, { children: tagline })), jsxRuntime.jsx("h4", Object.assign({ className: `${baseClass}--subhead` }, { children: subtagline }))] })), address && (jsxRuntime.jsx("div", Object.assign({ className: "address" }, { children: address.map((line, i) => (jsxRuntime.jsx("p", Object.assign({ className: "address--line" }, { children: line }), i))) }))), linkgroup && (jsxRuntime.jsx("nav", Object.assign({ className: "links" }, { children: jsxRuntime.jsx(components_LinkList_LinkList, { linkgroup: linkgroup, theme: "dark" }) }))), (socials || subscribe) && (jsxRuntime.jsxs("div", Object.assign({ className: "connect" }, { children: [socials && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h5", Object.assign({ className: "social--headline" }, { children: socials === null || socials === void 0 ? void 0 : socials.headline })), jsxRuntime.jsx("ul", Object.assign({ className: "social--links" }, { children: socials.links &&
|
|
20
|
+
socials.links.map((link, index) => (jsxRuntime.jsx("li", Object.assign({ className: "social--links--item" }, { children: jsxRuntime.jsx("a", Object.assign({ className: `social--links--link ${link.type}`, href: link.url }, { children: link.type })) }), index))) }))] })), subscribe && (jsxRuntime.jsx(components_Button_Button, { label: subscribe === null || subscribe === void 0 ? void 0 : subscribe.label, url: subscribe === null || subscribe === void 0 ? void 0 : subscribe.url, type: "primary", size: "large", target: "_blank" }))] })))] })), jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--secondary` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: "legal" }, { children: legal })), secondarylinks && (jsxRuntime.jsx("nav", Object.assign({ className: "secondarylinks" }, { children: jsxRuntime.jsx("ul", Object.assign({ className: "secondarylinks--list" }, { children: secondarylinks.map((link, i) => (jsxRuntime.jsx("li", Object.assign({ className: "secondarylinks--list--item" }, { children: jsxRuntime.jsx("a", Object.assign({ href: link.url, className: "secondarylinks--list--link" }, { children: link === null || link === void 0 ? void 0 : link.label }), i) })))) })) }))), jsxRuntime.jsx("a", Object.assign({ href: anchorlink === null || anchorlink === void 0 ? void 0 : anchorlink.url, className: "anchorlink" }, { children: anchorlink === null || anchorlink === void 0 ? void 0 : anchorlink.label }))] }))] })));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports = Footer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_Footer_Footer = require('./Footer.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('../../hooks/useGlobalSettings.js');
|
|
6
|
+
require('tslib');
|
|
7
|
+
require('react');
|
|
8
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
9
|
+
require('classnames');
|
|
10
|
+
require('../LinkList/LinkList.js');
|
|
11
|
+
require('../Button/Button.js');
|
|
12
|
+
require('../Link/Link.js');
|
|
13
|
+
require('../Icon/Icon.js');
|
|
14
|
+
require('@ilo-org/icons-react');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.Footer = components_Footer_Footer;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var require$$0 = require('react');
|
|
5
|
+
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
|
+
var components_ContextMenu_ContextMenu = require('../ContextMenu/ContextMenu.js');
|
|
7
|
+
var classNames = require('classnames');
|
|
8
|
+
require('tslib');
|
|
9
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
10
|
+
|
|
11
|
+
var brand = {
|
|
12
|
+
"ilo-blue": {
|
|
13
|
+
value: "rgba(30, 45, 190, 1)"
|
|
14
|
+
},
|
|
15
|
+
"ilo-red": {
|
|
16
|
+
value: "rgba(250, 60, 75, 1)"
|
|
17
|
+
},
|
|
18
|
+
"ilo-dark-blue": {
|
|
19
|
+
value: "rgba(35, 0, 80, 1)"
|
|
20
|
+
},
|
|
21
|
+
"ilo-yellow": {
|
|
22
|
+
value: "rgba(255, 205, 45, 1)"
|
|
23
|
+
},
|
|
24
|
+
"ilo-green": {
|
|
25
|
+
value: "rgba(140, 225, 100, 1)"
|
|
26
|
+
},
|
|
27
|
+
"ilo-purple": {
|
|
28
|
+
value: "rgba(150, 10, 85, 1)"
|
|
29
|
+
},
|
|
30
|
+
"ilo-purple-light": {
|
|
31
|
+
value: "rgba(116, 96, 145, 1)"
|
|
32
|
+
},
|
|
33
|
+
"ilo-turquoise": {
|
|
34
|
+
value: "rgba(5, 210, 210, 1)"
|
|
35
|
+
},
|
|
36
|
+
"ilo-dark-red": {
|
|
37
|
+
value: "rgba(200, 48, 60, 1)"
|
|
38
|
+
},
|
|
39
|
+
"ilo-lighter-blue": {
|
|
40
|
+
value: "rgba(235, 245, 253, 1)"
|
|
41
|
+
},
|
|
42
|
+
"ilo-light-blue": {
|
|
43
|
+
value: "rgba(235, 245, 253, 1)"
|
|
44
|
+
},
|
|
45
|
+
"ilo-grey-light-alternate": {
|
|
46
|
+
value: "rgba(246, 247, 248, 1)"
|
|
47
|
+
},
|
|
48
|
+
"ilo-grey-light": {
|
|
49
|
+
value: "rgba(237, 240, 242, 1)"
|
|
50
|
+
},
|
|
51
|
+
"ilo-grey-ui": {
|
|
52
|
+
value: "rgba(184, 196, 204, 1)"
|
|
53
|
+
},
|
|
54
|
+
"ilo-grey-accessible": {
|
|
55
|
+
value: "rgba(109, 109, 109, 1)"
|
|
56
|
+
},
|
|
57
|
+
"ilo-grey-charcoal": {
|
|
58
|
+
value: "rgba(45, 45, 45, 1)"
|
|
59
|
+
},
|
|
60
|
+
"ilo-black": {
|
|
61
|
+
value: "rgba(45, 45, 45, 1)"
|
|
62
|
+
},
|
|
63
|
+
"ilo-white": {
|
|
64
|
+
value: "rgba(255, 255, 255, 1)"
|
|
65
|
+
},
|
|
66
|
+
"ilo-ramp-blue": {
|
|
67
|
+
value: "rgba(190, 220, 250, 1)"
|
|
68
|
+
},
|
|
69
|
+
"ilo-ramp-red": {
|
|
70
|
+
value: "rgba(254, 216, 219, 1)"
|
|
71
|
+
},
|
|
72
|
+
"ilo-ramp-green": {
|
|
73
|
+
value: "rgba(232, 249, 224, 1)"
|
|
74
|
+
},
|
|
75
|
+
"ilo-ramp-yellow": {
|
|
76
|
+
value: "rgba(255, 245, 200, 1)"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const LocalNav = ({ background, logo, siteurl, primarynav, mainlink, menucloselabel, languagelabel, languagecontextmenu, }) => {
|
|
81
|
+
const { prefix } = hooks_useGlobalSettings();
|
|
82
|
+
const [toggleMenuOpen, setMenuToggleOpen] = require$$0.useState(false);
|
|
83
|
+
const [toggleLanguageOpen, setLanguageToggleOpen] = require$$0.useState(false);
|
|
84
|
+
const baseClass = `${prefix}--header`;
|
|
85
|
+
const localNavClasses = classNames(baseClass, `${baseClass}--local`, {
|
|
86
|
+
[`${prefix}--mobile--open`]: toggleMenuOpen,
|
|
87
|
+
[`${prefix}--select--open`]: toggleLanguageOpen,
|
|
88
|
+
});
|
|
89
|
+
const bg = background ? background : brand["ilo-dark-blue"].value;
|
|
90
|
+
const handleMenuToggle = () => {
|
|
91
|
+
setMenuToggleOpen(!toggleMenuOpen);
|
|
92
|
+
};
|
|
93
|
+
const handleLanguageToggle = () => {
|
|
94
|
+
setLanguageToggleOpen(!toggleLanguageOpen);
|
|
95
|
+
};
|
|
96
|
+
return (jsxRuntime.jsx("header", Object.assign({ className: localNavClasses }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--utility-bar ${baseClass}--utility-bar--local`, style: { background: bg } }, { children: [jsxRuntime.jsxs("nav", Object.assign({ className: `${prefix}--nav--local` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--nav--local--logo-wrapper` }, { children: jsxRuntime.jsx("a", Object.assign({ href: siteurl, className: `${prefix}--nav--local--logo-link` }, { children: jsxRuntime.jsx("img", { src: logo, alt: "ILO Logo", className: `${prefix}--nav--local--logo` }) })) })), jsxRuntime.jsx("ul", Object.assign({ className: `${prefix}--nav--local--set` }, { children: (primarynav === null || primarynav === void 0 ? void 0 : primarynav.items) &&
|
|
97
|
+
primarynav.items.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--local--item` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--local--link` }, { children: jsxRuntime.jsx("span", { children: item.label }) })) }), index))) }))] })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--language-switcher` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--language-switcher--wrap` }, { children: [mainlink && (jsxRuntime.jsx("span", Object.assign({ className: `${prefix}--language-switcher--link--wrap` }, { children: jsxRuntime.jsx("a", Object.assign({ href: mainlink.url, className: `${prefix}--language-switcher--link` }, { children: mainlink.label })) }))), jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--language-switcher--button`, type: "button" }, { children: languagelabel })), jsxRuntime.jsx(components_ContextMenu_ContextMenu, { links: languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links })] })) })), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu`, onClick: handleMenuToggle }, { children: "Menu" })), jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--navigation` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--inner` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--nav` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--nav--logo` }, { children: [jsxRuntime.jsx("a", Object.assign({ href: siteurl, className: `${baseClass}--logo-link` }, { children: jsxRuntime.jsx("img", { className: `${baseClass}--logo`, src: logo, alt: "ILO Logo" }) })), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: menucloselabel }))] })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--switcher` }, { children: jsxRuntime.jsx("button", Object.assign({ className: `${prefix}--mobile--nav--language--switcher--button`, onClick: handleLanguageToggle, type: "button" }, { children: languagelabel })) })), jsxRuntime.jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--select` }, { children: jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--inner` }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: `${prefix}--mobile--subnav--menu` }, { children: [jsxRuntime.jsx("button", { className: `${prefix}--mobile--subnav--back`, onClick: handleLanguageToggle, type: "button" }), jsxRuntime.jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: "Close" })), jsxRuntime.jsx("h6", Object.assign({ className: `${prefix}--mobile--subnav--label` }, { children: languagelabel }))] })), jsxRuntime.jsx("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: (languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links) &&
|
|
98
|
+
languagecontextmenu.links.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link ${prefix}--nav--language` }, { children: item.label })) }), index))) }))] })) }))] })), jsxRuntime.jsxs("nav", Object.assign({ className: `${prefix}--nav`, "aria-labelledby": "primary-navigation" }, { children: [jsxRuntime.jsx("h2", Object.assign({ className: `${prefix}--nav--label`, id: "primary-navigation" }, { children: primarynav === null || primarynav === void 0 ? void 0 : primarynav.navlabel })), jsxRuntime.jsx("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: (primarynav === null || primarynav === void 0 ? void 0 : primarynav.items) &&
|
|
99
|
+
primarynav.items.map((item, index) => (jsxRuntime.jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsxRuntime.jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link` }, { children: item.label })) }), index))) }))] }))] })) }))] })) })));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
module.exports = LocalNav;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_LocalNav_LocalNav = require('./LocalNav.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('../../hooks/useGlobalSettings.js');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
9
|
+
require('../ContextMenu/ContextMenu.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.LocalNav = components_LocalNav_LocalNav;
|
|
@@ -50,6 +50,8 @@ var components_List_List = require('./List/List.js');
|
|
|
50
50
|
require('../ListCtx-7db7fe04.js');
|
|
51
51
|
var components_Profile_Profile = require('./Profile/Profile.js');
|
|
52
52
|
var components_TableOfContents_TableOfContents = require('./TableOfContents/TableOfContents.js');
|
|
53
|
+
var components_Footer_Footer = require('./Footer/Footer.js');
|
|
54
|
+
var components_LocalNav_LocalNav = require('./LocalNav/LocalNav.js');
|
|
53
55
|
require('../hooks/useGlobalSettings.js');
|
|
54
56
|
require('../AccordionCtx-fe08ff45.js');
|
|
55
57
|
require('@ilo-org/utils');
|
|
@@ -113,3 +115,5 @@ exports.Icon = components_Icon_Icon;
|
|
|
113
115
|
exports.List = components_List_List;
|
|
114
116
|
exports.Profile = components_Profile_Profile;
|
|
115
117
|
exports.TableOfContents = components_TableOfContents_TableOfContents;
|
|
118
|
+
exports.Footer = components_Footer_Footer;
|
|
119
|
+
exports.LocalNav = components_LocalNav_LocalNav;
|
package/lib/cjs/index.js
CHANGED
|
@@ -50,6 +50,8 @@ var components_List_List = require('./components/List/List.js');
|
|
|
50
50
|
require('./ListCtx-7db7fe04.js');
|
|
51
51
|
var components_Profile_Profile = require('./components/Profile/Profile.js');
|
|
52
52
|
var components_TableOfContents_TableOfContents = require('./components/TableOfContents/TableOfContents.js');
|
|
53
|
+
var components_Footer_Footer = require('./components/Footer/Footer.js');
|
|
54
|
+
var components_LocalNav_LocalNav = require('./components/LocalNav/LocalNav.js');
|
|
53
55
|
require('./hooks/useGlobalSettings.js');
|
|
54
56
|
require('./AccordionCtx-fe08ff45.js');
|
|
55
57
|
require('@ilo-org/utils');
|
|
@@ -113,3 +115,5 @@ exports.Icon = components_Icon_Icon;
|
|
|
113
115
|
exports.List = components_List_List;
|
|
114
116
|
exports.Profile = components_Profile_Profile;
|
|
115
117
|
exports.TableOfContents = components_TableOfContents_TableOfContents;
|
|
118
|
+
exports.Footer = components_Footer_Footer;
|
|
119
|
+
exports.LocalNav = components_LocalNav_LocalNav;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import LinkList from '../LinkList/LinkList.js';
|
|
5
|
+
import Button from '../Button/Button.js';
|
|
6
|
+
import 'tslib';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
9
|
+
import '../Link/Link.js';
|
|
10
|
+
import '../Icon/Icon.js';
|
|
11
|
+
import '@ilo-org/icons-react';
|
|
12
|
+
|
|
13
|
+
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup, socials, subscribe, legal, secondarylinks, anchorlink, }) => {
|
|
14
|
+
const { prefix } = useGlobalSettings();
|
|
15
|
+
const baseClass = `${prefix}--footer`;
|
|
16
|
+
const footerClasses = classNames(className, baseClass);
|
|
17
|
+
return (jsxs("footer", Object.assign({ className: footerClasses }, { children: [jsxs("div", Object.assign({ className: `${baseClass}--main` }, { children: [jsxs("div", Object.assign({ className: "site--info" }, { children: [jsx("img", { className: `${baseClass}--logo`, src: logo, alt: "ILO Logo" }), jsx("h3", Object.assign({ className: `${baseClass}--headline` }, { children: tagline })), jsx("h4", Object.assign({ className: `${baseClass}--subhead` }, { children: subtagline }))] })), address && (jsx("div", Object.assign({ className: "address" }, { children: address.map((line, i) => (jsx("p", Object.assign({ className: "address--line" }, { children: line }), i))) }))), linkgroup && (jsx("nav", Object.assign({ className: "links" }, { children: jsx(LinkList, { linkgroup: linkgroup, theme: "dark" }) }))), (socials || subscribe) && (jsxs("div", Object.assign({ className: "connect" }, { children: [socials && (jsxs(Fragment, { children: [jsx("h5", Object.assign({ className: "social--headline" }, { children: socials === null || socials === void 0 ? void 0 : socials.headline })), jsx("ul", Object.assign({ className: "social--links" }, { children: socials.links &&
|
|
18
|
+
socials.links.map((link, index) => (jsx("li", Object.assign({ className: "social--links--item" }, { children: jsx("a", Object.assign({ className: `social--links--link ${link.type}`, href: link.url }, { children: link.type })) }), index))) }))] })), subscribe && (jsx(Button, { label: subscribe === null || subscribe === void 0 ? void 0 : subscribe.label, url: subscribe === null || subscribe === void 0 ? void 0 : subscribe.url, type: "primary", size: "large", target: "_blank" }))] })))] })), jsxs("div", Object.assign({ className: `${baseClass}--secondary` }, { children: [jsx("div", Object.assign({ className: "legal" }, { children: legal })), secondarylinks && (jsx("nav", Object.assign({ className: "secondarylinks" }, { children: jsx("ul", Object.assign({ className: "secondarylinks--list" }, { children: secondarylinks.map((link, i) => (jsx("li", Object.assign({ className: "secondarylinks--list--item" }, { children: jsx("a", Object.assign({ href: link.url, className: "secondarylinks--list--link" }, { children: link === null || link === void 0 ? void 0 : link.label }), i) })))) })) }))), jsx("a", Object.assign({ href: anchorlink === null || anchorlink === void 0 ? void 0 : anchorlink.url, className: "anchorlink" }, { children: anchorlink === null || anchorlink === void 0 ? void 0 : anchorlink.label }))] }))] })));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { Footer as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as Footer } from './Footer.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '../../hooks/useGlobalSettings.js';
|
|
4
|
+
import 'tslib';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import '../LinkList/LinkList.js';
|
|
9
|
+
import '../Button/Button.js';
|
|
10
|
+
import '../Link/Link.js';
|
|
11
|
+
import '../Icon/Icon.js';
|
|
12
|
+
import '@ilo-org/icons-react';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
|
+
import ContextMenu from '../ContextMenu/ContextMenu.js';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import 'tslib';
|
|
7
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
8
|
+
|
|
9
|
+
var brand = {
|
|
10
|
+
"ilo-blue": {
|
|
11
|
+
value: "rgba(30, 45, 190, 1)"
|
|
12
|
+
},
|
|
13
|
+
"ilo-red": {
|
|
14
|
+
value: "rgba(250, 60, 75, 1)"
|
|
15
|
+
},
|
|
16
|
+
"ilo-dark-blue": {
|
|
17
|
+
value: "rgba(35, 0, 80, 1)"
|
|
18
|
+
},
|
|
19
|
+
"ilo-yellow": {
|
|
20
|
+
value: "rgba(255, 205, 45, 1)"
|
|
21
|
+
},
|
|
22
|
+
"ilo-green": {
|
|
23
|
+
value: "rgba(140, 225, 100, 1)"
|
|
24
|
+
},
|
|
25
|
+
"ilo-purple": {
|
|
26
|
+
value: "rgba(150, 10, 85, 1)"
|
|
27
|
+
},
|
|
28
|
+
"ilo-purple-light": {
|
|
29
|
+
value: "rgba(116, 96, 145, 1)"
|
|
30
|
+
},
|
|
31
|
+
"ilo-turquoise": {
|
|
32
|
+
value: "rgba(5, 210, 210, 1)"
|
|
33
|
+
},
|
|
34
|
+
"ilo-dark-red": {
|
|
35
|
+
value: "rgba(200, 48, 60, 1)"
|
|
36
|
+
},
|
|
37
|
+
"ilo-lighter-blue": {
|
|
38
|
+
value: "rgba(235, 245, 253, 1)"
|
|
39
|
+
},
|
|
40
|
+
"ilo-light-blue": {
|
|
41
|
+
value: "rgba(235, 245, 253, 1)"
|
|
42
|
+
},
|
|
43
|
+
"ilo-grey-light-alternate": {
|
|
44
|
+
value: "rgba(246, 247, 248, 1)"
|
|
45
|
+
},
|
|
46
|
+
"ilo-grey-light": {
|
|
47
|
+
value: "rgba(237, 240, 242, 1)"
|
|
48
|
+
},
|
|
49
|
+
"ilo-grey-ui": {
|
|
50
|
+
value: "rgba(184, 196, 204, 1)"
|
|
51
|
+
},
|
|
52
|
+
"ilo-grey-accessible": {
|
|
53
|
+
value: "rgba(109, 109, 109, 1)"
|
|
54
|
+
},
|
|
55
|
+
"ilo-grey-charcoal": {
|
|
56
|
+
value: "rgba(45, 45, 45, 1)"
|
|
57
|
+
},
|
|
58
|
+
"ilo-black": {
|
|
59
|
+
value: "rgba(45, 45, 45, 1)"
|
|
60
|
+
},
|
|
61
|
+
"ilo-white": {
|
|
62
|
+
value: "rgba(255, 255, 255, 1)"
|
|
63
|
+
},
|
|
64
|
+
"ilo-ramp-blue": {
|
|
65
|
+
value: "rgba(190, 220, 250, 1)"
|
|
66
|
+
},
|
|
67
|
+
"ilo-ramp-red": {
|
|
68
|
+
value: "rgba(254, 216, 219, 1)"
|
|
69
|
+
},
|
|
70
|
+
"ilo-ramp-green": {
|
|
71
|
+
value: "rgba(232, 249, 224, 1)"
|
|
72
|
+
},
|
|
73
|
+
"ilo-ramp-yellow": {
|
|
74
|
+
value: "rgba(255, 245, 200, 1)"
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const LocalNav = ({ background, logo, siteurl, primarynav, mainlink, menucloselabel, languagelabel, languagecontextmenu, }) => {
|
|
79
|
+
const { prefix } = useGlobalSettings();
|
|
80
|
+
const [toggleMenuOpen, setMenuToggleOpen] = useState(false);
|
|
81
|
+
const [toggleLanguageOpen, setLanguageToggleOpen] = useState(false);
|
|
82
|
+
const baseClass = `${prefix}--header`;
|
|
83
|
+
const localNavClasses = classNames(baseClass, `${baseClass}--local`, {
|
|
84
|
+
[`${prefix}--mobile--open`]: toggleMenuOpen,
|
|
85
|
+
[`${prefix}--select--open`]: toggleLanguageOpen,
|
|
86
|
+
});
|
|
87
|
+
const bg = background ? background : brand["ilo-dark-blue"].value;
|
|
88
|
+
const handleMenuToggle = () => {
|
|
89
|
+
setMenuToggleOpen(!toggleMenuOpen);
|
|
90
|
+
};
|
|
91
|
+
const handleLanguageToggle = () => {
|
|
92
|
+
setLanguageToggleOpen(!toggleLanguageOpen);
|
|
93
|
+
};
|
|
94
|
+
return (jsx("header", Object.assign({ className: localNavClasses }, { children: jsxs("div", Object.assign({ className: `${baseClass}--utility-bar ${baseClass}--utility-bar--local`, style: { background: bg } }, { children: [jsxs("nav", Object.assign({ className: `${prefix}--nav--local` }, { children: [jsx("div", Object.assign({ className: `${prefix}--nav--local--logo-wrapper` }, { children: jsx("a", Object.assign({ href: siteurl, className: `${prefix}--nav--local--logo-link` }, { children: jsx("img", { src: logo, alt: "ILO Logo", className: `${prefix}--nav--local--logo` }) })) })), jsx("ul", Object.assign({ className: `${prefix}--nav--local--set` }, { children: (primarynav === null || primarynav === void 0 ? void 0 : primarynav.items) &&
|
|
95
|
+
primarynav.items.map((item, index) => (jsx("li", Object.assign({ className: `${prefix}--nav--local--item` }, { children: jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--local--link` }, { children: jsx("span", { children: item.label }) })) }), index))) }))] })), jsx("div", Object.assign({ className: `${prefix}--language-switcher` }, { children: jsxs("div", Object.assign({ className: `${prefix}--language-switcher--wrap` }, { children: [mainlink && (jsx("span", Object.assign({ className: `${prefix}--language-switcher--link--wrap` }, { children: jsx("a", Object.assign({ href: mainlink.url, className: `${prefix}--language-switcher--link` }, { children: mainlink.label })) }))), jsx("button", Object.assign({ className: `${prefix}--language-switcher--button`, type: "button" }, { children: languagelabel })), jsx(ContextMenu, { links: languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links })] })) })), jsx("button", Object.assign({ className: `${baseClass}--menu`, onClick: handleMenuToggle }, { children: "Menu" })), jsx("div", Object.assign({ className: `${baseClass}--navigation` }, { children: jsxs("div", Object.assign({ className: `${baseClass}--inner` }, { children: [jsxs("div", Object.assign({ className: `${prefix}--mobile--nav` }, { children: [jsxs("div", Object.assign({ className: `${prefix}--mobile--nav--logo` }, { children: [jsx("a", Object.assign({ href: siteurl, className: `${baseClass}--logo-link` }, { children: jsx("img", { className: `${baseClass}--logo`, src: logo, alt: "ILO Logo" }) })), jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: menucloselabel }))] })), jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--switcher` }, { children: jsx("button", Object.assign({ className: `${prefix}--mobile--nav--language--switcher--button`, onClick: handleLanguageToggle, type: "button" }, { children: languagelabel })) })), jsx("div", Object.assign({ className: `${prefix}--mobile--nav--language--select` }, { children: jsxs("div", Object.assign({ className: `${baseClass}--inner` }, { children: [jsxs("div", Object.assign({ className: `${prefix}--mobile--subnav--menu` }, { children: [jsx("button", { className: `${prefix}--mobile--subnav--back`, onClick: handleLanguageToggle, type: "button" }), jsx("button", Object.assign({ className: `${baseClass}--menu--close`, onClick: handleMenuToggle }, { children: "Close" })), jsx("h6", Object.assign({ className: `${prefix}--mobile--subnav--label` }, { children: languagelabel }))] })), jsx("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: (languagecontextmenu === null || languagecontextmenu === void 0 ? void 0 : languagecontextmenu.links) &&
|
|
96
|
+
languagecontextmenu.links.map((item, index) => (jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link ${prefix}--nav--language` }, { children: item.label })) }), index))) }))] })) }))] })), jsxs("nav", Object.assign({ className: `${prefix}--nav`, "aria-labelledby": "primary-navigation" }, { children: [jsx("h2", Object.assign({ className: `${prefix}--nav--label`, id: "primary-navigation" }, { children: primarynav === null || primarynav === void 0 ? void 0 : primarynav.navlabel })), jsx("ul", Object.assign({ className: `${prefix}--nav--set` }, { children: (primarynav === null || primarynav === void 0 ? void 0 : primarynav.items) &&
|
|
97
|
+
primarynav.items.map((item, index) => (jsx("li", Object.assign({ className: `${prefix}--nav--items` }, { children: jsx("a", Object.assign({ href: item.url, className: `${prefix}--nav--link` }, { children: item.label })) }), index))) }))] }))] })) }))] })) })));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export { LocalNav as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as LocalNav } from './LocalNav.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../hooks/useGlobalSettings.js';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
7
|
+
import '../ContextMenu/ContextMenu.js';
|
|
8
|
+
import 'classnames';
|
|
@@ -48,6 +48,8 @@ export { default as List } from './List/List.js';
|
|
|
48
48
|
import '../ListCtx-da435fdf.js';
|
|
49
49
|
export { default as Profile } from './Profile/Profile.js';
|
|
50
50
|
export { default as TableOfContents } from './TableOfContents/TableOfContents.js';
|
|
51
|
+
export { default as Footer } from './Footer/Footer.js';
|
|
52
|
+
export { default as LocalNav } from './LocalNav/LocalNav.js';
|
|
51
53
|
import '../hooks/useGlobalSettings.js';
|
|
52
54
|
import '../AccordionCtx-8c051900.js';
|
|
53
55
|
import '@ilo-org/utils';
|
package/lib/esm/index.js
CHANGED
|
@@ -48,6 +48,8 @@ export { default as List } from './components/List/List.js';
|
|
|
48
48
|
import './ListCtx-da435fdf.js';
|
|
49
49
|
export { default as Profile } from './components/Profile/Profile.js';
|
|
50
50
|
export { default as TableOfContents } from './components/TableOfContents/TableOfContents.js';
|
|
51
|
+
export { default as Footer } from './components/Footer/Footer.js';
|
|
52
|
+
export { default as LocalNav } from './components/LocalNav/LocalNav.js';
|
|
51
53
|
import './hooks/useGlobalSettings.js';
|
|
52
54
|
import './AccordionCtx-8c051900.js';
|
|
53
55
|
import '@ilo-org/utils';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { LinkGroupProps } from "../LinkList/LinkList.props";
|
|
2
|
+
import { LinkProps } from "../LinkList/LinkList.props";
|
|
3
|
+
import { SocialTypes } from "../../types";
|
|
4
|
+
export interface FooterProps {
|
|
5
|
+
/**
|
|
6
|
+
* Specify an optional className to be added to your Footer.
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Props for the logo of the Footer
|
|
11
|
+
*/
|
|
12
|
+
logo?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Specify the tagline for the Footer
|
|
15
|
+
*/
|
|
16
|
+
tagline?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Specify the subtagline for the Footer
|
|
19
|
+
*/
|
|
20
|
+
subtagline?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Specify the address for the Footer, in multiple lines
|
|
23
|
+
*/
|
|
24
|
+
address?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Specify the linkgroup for the Footer's links
|
|
27
|
+
*/
|
|
28
|
+
linkgroup?: Required<Array<LinkGroupProps>>;
|
|
29
|
+
/**
|
|
30
|
+
* Specify the links to be displayed in this link group
|
|
31
|
+
*/
|
|
32
|
+
socials?: FooterSocialProps;
|
|
33
|
+
/**
|
|
34
|
+
* Specify the legal statement for the Footer
|
|
35
|
+
*/
|
|
36
|
+
subscribe?: LinkProps;
|
|
37
|
+
/**
|
|
38
|
+
* Specify the legal statement for the Footer
|
|
39
|
+
*/
|
|
40
|
+
legal?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Specify the secondary links for the Footer
|
|
43
|
+
*/
|
|
44
|
+
secondarylinks?: LinkProps[];
|
|
45
|
+
/**
|
|
46
|
+
* Specify the anchor link for the Footer
|
|
47
|
+
*/
|
|
48
|
+
anchorlink?: LinkProps;
|
|
49
|
+
}
|
|
50
|
+
interface FooterSocialProps {
|
|
51
|
+
/**
|
|
52
|
+
* Specify the headline for social links
|
|
53
|
+
*/
|
|
54
|
+
headline?: Required<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Specify the social links
|
|
57
|
+
*/
|
|
58
|
+
links?: Required<SocialLinkProps>[];
|
|
59
|
+
}
|
|
60
|
+
interface SocialLinkProps {
|
|
61
|
+
/**
|
|
62
|
+
* Specify the type for social link
|
|
63
|
+
*/
|
|
64
|
+
type?: Required<SocialTypes>;
|
|
65
|
+
/**
|
|
66
|
+
* Specify the url for social link
|
|
67
|
+
*/
|
|
68
|
+
url?: Required<string>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Footer } from "./Footer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LinkListThemes } from "../../types";
|
|
2
|
-
interface LinkProps {
|
|
2
|
+
export interface LinkProps {
|
|
3
3
|
/**
|
|
4
4
|
* Specify if this link should indent and have a triangle icon
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@ interface LinkProps {
|
|
|
13
13
|
*/
|
|
14
14
|
url?: Required<string>;
|
|
15
15
|
}
|
|
16
|
-
interface LinkGroupProps {
|
|
16
|
+
export interface LinkGroupProps {
|
|
17
17
|
/**
|
|
18
18
|
* Specify an optional headline for this link group
|
|
19
19
|
*/
|
|
@@ -41,4 +41,3 @@ export interface LinkListProps {
|
|
|
41
41
|
*/
|
|
42
42
|
theme?: Required<LinkListThemes>;
|
|
43
43
|
}
|
|
44
|
-
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LinkProps, ContextMenuProps } from "../ContextMenu/ContextMenu.props";
|
|
2
|
+
export interface LocalNavProps {
|
|
3
|
+
/**
|
|
4
|
+
* Props for the background colour of the LocalNav
|
|
5
|
+
*/
|
|
6
|
+
background?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Props for the logo of the LocalNav
|
|
9
|
+
*/
|
|
10
|
+
logo?: Required<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Props for the home url of the LocalNav
|
|
13
|
+
*/
|
|
14
|
+
siteurl?: Required<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Specify the primary items for the LocalNav
|
|
17
|
+
*/
|
|
18
|
+
primarynav?: Required<PrimaryNavProps>;
|
|
19
|
+
/**
|
|
20
|
+
* Specify the main link for the LocalNav
|
|
21
|
+
*/
|
|
22
|
+
mainlink?: LinkProps;
|
|
23
|
+
/**
|
|
24
|
+
* Specify the menu close label for the LocalNav
|
|
25
|
+
*/
|
|
26
|
+
menucloselabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the language label for the LocalNav
|
|
29
|
+
*/
|
|
30
|
+
languagelabel?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Specify the language context menu for the LocalNav
|
|
33
|
+
*/
|
|
34
|
+
languagecontextmenu?: ContextMenuProps;
|
|
35
|
+
}
|
|
36
|
+
interface PrimaryNavProps {
|
|
37
|
+
/**
|
|
38
|
+
* Specify the label for local nav
|
|
39
|
+
*/
|
|
40
|
+
navlabel?: Required<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Specify the close label for mobile local nav
|
|
43
|
+
*/
|
|
44
|
+
mobilecloselabel?: Required<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Specify the social links
|
|
47
|
+
*/
|
|
48
|
+
items?: Required<Array<LinkProps>>;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LocalNav } from "./LocalNav";
|
|
@@ -24,3 +24,4 @@ export type NotificationTypes = "error" | "info" | "success" | "warning";
|
|
|
24
24
|
export type PositionTypes = "top" | "bottom" | "left" | "right";
|
|
25
25
|
export type SizeTypes = "small" | "medium" | "large";
|
|
26
26
|
export type TagTypes = "anchor" | "display" | "button";
|
|
27
|
+
export type SocialTypes = "instagram" | "facebook" | "twitter" | "youtube";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React components for the ILO's Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui_patterns",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@ilo-org/brand-assets": "0.1.0",
|
|
75
75
|
"@ilo-org/fonts": "0.1.0",
|
|
76
76
|
"@ilo-org/icons-react": "0.0.18",
|
|
77
|
-
"@ilo-org/styles": "0.1.
|
|
77
|
+
"@ilo-org/styles": "0.1.18",
|
|
78
78
|
"@ilo-org/themes": "0.1.15",
|
|
79
79
|
"@ilo-org/utils": "0.0.11"
|
|
80
80
|
},
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"tslib": "^2.3.1",
|
|
135
135
|
"typescript": "4.9.3",
|
|
136
136
|
"webpack": "^5.68.0",
|
|
137
|
-
"@ilo-org/eslint-config": "0.0.
|
|
138
|
-
"@ilo-org/prettier-config": "0.0.
|
|
137
|
+
"@ilo-org/eslint-config": "0.0.3",
|
|
138
|
+
"@ilo-org/prettier-config": "0.0.2",
|
|
139
139
|
"@ilo-org/typescript-config": "0.0.1"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { FooterProps } from "./Footer.props";
|
|
2
|
+
import ilo_logo_white from "@ilo-org/brand-assets/logo_en_horizontal_white.svg";
|
|
3
|
+
|
|
4
|
+
const basic: FooterProps = {
|
|
5
|
+
className: "footer",
|
|
6
|
+
logo: ilo_logo_white,
|
|
7
|
+
tagline: "Advancing social justice, promoting decent work",
|
|
8
|
+
subtagline: "ILO is a specialized agency of the United Nations",
|
|
9
|
+
address: [
|
|
10
|
+
"International Labour Organization",
|
|
11
|
+
"4 route des Morillons",
|
|
12
|
+
"CH-1211 Genève 22",
|
|
13
|
+
"Switzerland",
|
|
14
|
+
],
|
|
15
|
+
linkgroup: [
|
|
16
|
+
{
|
|
17
|
+
links: [
|
|
18
|
+
{
|
|
19
|
+
label: "Link One",
|
|
20
|
+
url: "https://www.ilo.org",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Link Two",
|
|
24
|
+
url: "https://www.ilo.org",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Link Three",
|
|
28
|
+
url: "https://www.ilo.org",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Link Four",
|
|
32
|
+
url: "https://www.ilo.org",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "Link Five",
|
|
36
|
+
url: "https://www.ilo.org",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "Link Six",
|
|
40
|
+
url: "https://www.ilo.org",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
socials: {
|
|
46
|
+
headline: "Social Links Headline",
|
|
47
|
+
links: [
|
|
48
|
+
{
|
|
49
|
+
type: "instagram",
|
|
50
|
+
url: "https://www.instagram.com/iloinfo/",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "facebook",
|
|
54
|
+
url: "https://www.facebook.com/ILO.ORG/",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "twitter",
|
|
58
|
+
url: "https://twitter.com/ILO/",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "youtube",
|
|
62
|
+
url: "https://youtube.com/@ILO/featured/",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
subscribe: {
|
|
67
|
+
label: "Subscribe",
|
|
68
|
+
url: "https://www.ilo.org",
|
|
69
|
+
},
|
|
70
|
+
legal: "© 1996-2023 International Labour Organization (ILO)",
|
|
71
|
+
secondarylinks: [
|
|
72
|
+
{
|
|
73
|
+
label: "Link One",
|
|
74
|
+
url: "https://www.ilo.org",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "Link Two",
|
|
78
|
+
url: "https://www.ilo.org",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: "Link Three",
|
|
82
|
+
url: "https://www.ilo.org",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: "Link Four",
|
|
86
|
+
url: "https://www.ilo.org",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: "Link Five",
|
|
90
|
+
url: "https://www.ilo.org",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "Link Six",
|
|
94
|
+
url: "https://www.ilo.org",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
anchorlink: {
|
|
98
|
+
label: "Back to Top",
|
|
99
|
+
url: "#anchor",
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const FooterArgs = { basic };
|
|
104
|
+
|
|
105
|
+
export default FooterArgs;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { LinkGroupProps } from "../LinkList/LinkList.props";
|
|
2
|
+
import { LinkProps } from "../LinkList/LinkList.props";
|
|
3
|
+
import { SocialTypes } from "../../types";
|
|
4
|
+
|
|
5
|
+
export interface FooterProps {
|
|
6
|
+
/**
|
|
7
|
+
* Specify an optional className to be added to your Footer.
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for the logo of the Footer
|
|
13
|
+
*/
|
|
14
|
+
logo?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Specify the tagline for the Footer
|
|
18
|
+
*/
|
|
19
|
+
tagline?: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Specify the subtagline for the Footer
|
|
23
|
+
*/
|
|
24
|
+
subtagline?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Specify the address for the Footer, in multiple lines
|
|
28
|
+
*/
|
|
29
|
+
address?: string[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specify the linkgroup for the Footer's links
|
|
33
|
+
*/
|
|
34
|
+
linkgroup?: Required<Array<LinkGroupProps>>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Specify the links to be displayed in this link group
|
|
38
|
+
*/
|
|
39
|
+
socials?: FooterSocialProps;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Specify the legal statement for the Footer
|
|
43
|
+
*/
|
|
44
|
+
subscribe?: LinkProps;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Specify the legal statement for the Footer
|
|
48
|
+
*/
|
|
49
|
+
legal?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Specify the secondary links for the Footer
|
|
53
|
+
*/
|
|
54
|
+
secondarylinks?: LinkProps[];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Specify the anchor link for the Footer
|
|
58
|
+
*/
|
|
59
|
+
anchorlink?: LinkProps;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface FooterSocialProps {
|
|
63
|
+
/**
|
|
64
|
+
* Specify the headline for social links
|
|
65
|
+
*/
|
|
66
|
+
headline?: Required<string>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Specify the social links
|
|
70
|
+
*/
|
|
71
|
+
links?: Required<SocialLinkProps>[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface SocialLinkProps {
|
|
75
|
+
/**
|
|
76
|
+
* Specify the type for social link
|
|
77
|
+
*/
|
|
78
|
+
type?: Required<SocialTypes>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Specify the url for social link
|
|
82
|
+
*/
|
|
83
|
+
url?: Required<string>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import { FooterProps } from "./Footer.props";
|
|
5
|
+
import { LinkList } from "../LinkList";
|
|
6
|
+
import { Button } from "../Button";
|
|
7
|
+
|
|
8
|
+
const Footer: FC<FooterProps> = ({
|
|
9
|
+
className,
|
|
10
|
+
logo,
|
|
11
|
+
tagline,
|
|
12
|
+
subtagline,
|
|
13
|
+
address,
|
|
14
|
+
linkgroup,
|
|
15
|
+
socials,
|
|
16
|
+
subscribe,
|
|
17
|
+
legal,
|
|
18
|
+
secondarylinks,
|
|
19
|
+
anchorlink,
|
|
20
|
+
}) => {
|
|
21
|
+
const { prefix } = useGlobalSettings();
|
|
22
|
+
|
|
23
|
+
const baseClass = `${prefix}--footer`;
|
|
24
|
+
const footerClasses = classnames(className, baseClass);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<footer className={footerClasses}>
|
|
28
|
+
<div className={`${baseClass}--main`}>
|
|
29
|
+
<div className="site--info">
|
|
30
|
+
<img className={`${baseClass}--logo`} src={logo} alt="ILO Logo" />
|
|
31
|
+
<h3 className={`${baseClass}--headline`}>{tagline}</h3>
|
|
32
|
+
<h4 className={`${baseClass}--subhead`}>{subtagline}</h4>
|
|
33
|
+
</div>
|
|
34
|
+
{address && (
|
|
35
|
+
<div className="address">
|
|
36
|
+
{address.map((line, i) => (
|
|
37
|
+
<p key={i} className="address--line">
|
|
38
|
+
{line}
|
|
39
|
+
</p>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
{linkgroup && (
|
|
44
|
+
<nav className="links">
|
|
45
|
+
<LinkList linkgroup={linkgroup} theme="dark"></LinkList>
|
|
46
|
+
</nav>
|
|
47
|
+
)}
|
|
48
|
+
{(socials || subscribe) && (
|
|
49
|
+
<div className="connect">
|
|
50
|
+
{socials && (
|
|
51
|
+
<>
|
|
52
|
+
<h5 className="social--headline">{socials?.headline}</h5>
|
|
53
|
+
<ul className="social--links">
|
|
54
|
+
{socials.links &&
|
|
55
|
+
socials.links.map((link, index) => (
|
|
56
|
+
<li className="social--links--item" key={index}>
|
|
57
|
+
<a
|
|
58
|
+
className={`social--links--link ${link.type}`}
|
|
59
|
+
href={link.url}
|
|
60
|
+
>
|
|
61
|
+
{link.type}
|
|
62
|
+
</a>
|
|
63
|
+
</li>
|
|
64
|
+
))}
|
|
65
|
+
</ul>
|
|
66
|
+
</>
|
|
67
|
+
)}
|
|
68
|
+
{subscribe && (
|
|
69
|
+
<Button
|
|
70
|
+
label={subscribe?.label}
|
|
71
|
+
url={subscribe?.url}
|
|
72
|
+
type="primary"
|
|
73
|
+
size="large"
|
|
74
|
+
target="_blank"
|
|
75
|
+
></Button>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
<div className={`${baseClass}--secondary`}>
|
|
81
|
+
<div className="legal">{legal}</div>
|
|
82
|
+
{secondarylinks && (
|
|
83
|
+
<nav className="secondarylinks">
|
|
84
|
+
<ul className="secondarylinks--list">
|
|
85
|
+
{secondarylinks.map((link, i) => (
|
|
86
|
+
<li className="secondarylinks--list--item">
|
|
87
|
+
<a
|
|
88
|
+
key={i}
|
|
89
|
+
href={link.url}
|
|
90
|
+
className="secondarylinks--list--link"
|
|
91
|
+
>
|
|
92
|
+
{link?.label}
|
|
93
|
+
</a>
|
|
94
|
+
</li>
|
|
95
|
+
))}
|
|
96
|
+
</ul>
|
|
97
|
+
</nav>
|
|
98
|
+
)}
|
|
99
|
+
<a href={anchorlink?.url} className="anchorlink">
|
|
100
|
+
{anchorlink?.label}
|
|
101
|
+
</a>
|
|
102
|
+
</div>
|
|
103
|
+
</footer>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default Footer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Footer } from "./Footer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LinkListThemes } from "../../types";
|
|
2
2
|
|
|
3
|
-
interface LinkProps {
|
|
3
|
+
export interface LinkProps {
|
|
4
4
|
/**
|
|
5
5
|
* Specify if this link should indent and have a triangle icon
|
|
6
6
|
*/
|
|
@@ -17,7 +17,7 @@ interface LinkProps {
|
|
|
17
17
|
url?: Required<string>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface LinkGroupProps {
|
|
20
|
+
export interface LinkGroupProps {
|
|
21
21
|
/**
|
|
22
22
|
* Specify an optional headline for this link group
|
|
23
23
|
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LocalNavProps } from "./LocalNav.props";
|
|
2
|
+
import ilo_logo_white from "@ilo-org/brand-assets/logo_en_horizontal_white.svg";
|
|
3
|
+
|
|
4
|
+
const basic: LocalNavProps = {
|
|
5
|
+
background: "#960A55",
|
|
6
|
+
logo: ilo_logo_white,
|
|
7
|
+
siteurl: "https://www.ilo.org/",
|
|
8
|
+
primarynav: {
|
|
9
|
+
navlabel: "Primary Nav Menu",
|
|
10
|
+
mobilecloselabel: "Close",
|
|
11
|
+
items: [
|
|
12
|
+
{
|
|
13
|
+
label: "Menu Item 1",
|
|
14
|
+
url: "https://www.ilo.org",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Menu Item 2",
|
|
18
|
+
url: "https://www.ilo.org",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Menu Item 3",
|
|
22
|
+
url: "https://www.ilo.org",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Menu Item 4",
|
|
26
|
+
url: "https://www.ilo.org",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Menu Item 5",
|
|
30
|
+
url: "https://www.ilo.org",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
mainlink: {
|
|
35
|
+
label: "Go to main website",
|
|
36
|
+
url: "https://www.ilo.org",
|
|
37
|
+
},
|
|
38
|
+
languagelabel: "English",
|
|
39
|
+
menucloselabel: "Close",
|
|
40
|
+
languagecontextmenu: {
|
|
41
|
+
links: [
|
|
42
|
+
{
|
|
43
|
+
label: "Français",
|
|
44
|
+
url: "https://www.ilo.org",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "Español",
|
|
48
|
+
url: "https://www.ilo.org",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "中文",
|
|
52
|
+
url: "https://www.ilo.org",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "Русский",
|
|
56
|
+
url: "https://www.ilo.org",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const LocalNavArgs = { basic };
|
|
63
|
+
|
|
64
|
+
export default LocalNavArgs;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LinkProps, ContextMenuProps } from "../ContextMenu/ContextMenu.props";
|
|
2
|
+
|
|
3
|
+
export interface LocalNavProps {
|
|
4
|
+
/**
|
|
5
|
+
* Props for the background colour of the LocalNav
|
|
6
|
+
*/
|
|
7
|
+
background?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the logo of the LocalNav
|
|
11
|
+
*/
|
|
12
|
+
logo?: Required<string>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Props for the home url of the LocalNav
|
|
16
|
+
*/
|
|
17
|
+
siteurl?: Required<string>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Specify the primary items for the LocalNav
|
|
21
|
+
*/
|
|
22
|
+
primarynav?: Required<PrimaryNavProps>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specify the main link for the LocalNav
|
|
26
|
+
*/
|
|
27
|
+
mainlink?: LinkProps;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Specify the menu close label for the LocalNav
|
|
31
|
+
*/
|
|
32
|
+
menucloselabel?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specify the language label for the LocalNav
|
|
36
|
+
*/
|
|
37
|
+
languagelabel?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Specify the language context menu for the LocalNav
|
|
41
|
+
*/
|
|
42
|
+
languagecontextmenu?: ContextMenuProps;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PrimaryNavProps {
|
|
46
|
+
/**
|
|
47
|
+
* Specify the label for local nav
|
|
48
|
+
*/
|
|
49
|
+
navlabel?: Required<string>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Specify the close label for mobile local nav
|
|
53
|
+
*/
|
|
54
|
+
mobilecloselabel?: Required<string>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Specify the social links
|
|
58
|
+
*/
|
|
59
|
+
items?: Required<Array<LinkProps>>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { FC, useState } from "react";
|
|
2
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
3
|
+
import { ContextMenu } from "../ContextMenu";
|
|
4
|
+
import { LocalNavProps } from "./LocalNav.props";
|
|
5
|
+
import { brand } from "@ilo-org/themes/tokens/brand/base.json";
|
|
6
|
+
import classnames from "classnames";
|
|
7
|
+
|
|
8
|
+
const LocalNav: FC<LocalNavProps> = ({
|
|
9
|
+
background,
|
|
10
|
+
logo,
|
|
11
|
+
siteurl,
|
|
12
|
+
primarynav,
|
|
13
|
+
mainlink,
|
|
14
|
+
menucloselabel,
|
|
15
|
+
languagelabel,
|
|
16
|
+
languagecontextmenu,
|
|
17
|
+
}) => {
|
|
18
|
+
const { prefix } = useGlobalSettings();
|
|
19
|
+
|
|
20
|
+
const [toggleMenuOpen, setMenuToggleOpen] = useState(false);
|
|
21
|
+
const [toggleLanguageOpen, setLanguageToggleOpen] = useState(false);
|
|
22
|
+
|
|
23
|
+
const baseClass = `${prefix}--header`;
|
|
24
|
+
const localNavClasses = classnames(baseClass, `${baseClass}--local`, {
|
|
25
|
+
[`${prefix}--mobile--open`]: toggleMenuOpen,
|
|
26
|
+
[`${prefix}--select--open`]: toggleLanguageOpen,
|
|
27
|
+
});
|
|
28
|
+
const bg = background ? background : brand["ilo-dark-blue"].value;
|
|
29
|
+
|
|
30
|
+
const handleMenuToggle = () => {
|
|
31
|
+
setMenuToggleOpen(!toggleMenuOpen);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleLanguageToggle = () => {
|
|
35
|
+
setLanguageToggleOpen(!toggleLanguageOpen);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<header className={localNavClasses}>
|
|
40
|
+
<div
|
|
41
|
+
className={`${baseClass}--utility-bar ${baseClass}--utility-bar--local`}
|
|
42
|
+
style={{ background: bg }}
|
|
43
|
+
>
|
|
44
|
+
<nav className={`${prefix}--nav--local`}>
|
|
45
|
+
<div className={`${prefix}--nav--local--logo-wrapper`}>
|
|
46
|
+
<a href={siteurl} className={`${prefix}--nav--local--logo-link`}>
|
|
47
|
+
<img
|
|
48
|
+
src={logo}
|
|
49
|
+
alt="ILO Logo"
|
|
50
|
+
className={`${prefix}--nav--local--logo`}
|
|
51
|
+
/>
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
<ul className={`${prefix}--nav--local--set`}>
|
|
55
|
+
{primarynav?.items &&
|
|
56
|
+
primarynav.items.map((item, index) => (
|
|
57
|
+
<li className={`${prefix}--nav--local--item`} key={index}>
|
|
58
|
+
<a href={item.url} className={`${prefix}--nav--local--link`}>
|
|
59
|
+
<span>{item.label}</span>
|
|
60
|
+
</a>
|
|
61
|
+
</li>
|
|
62
|
+
))}
|
|
63
|
+
</ul>
|
|
64
|
+
</nav>
|
|
65
|
+
<div className={`${prefix}--language-switcher`}>
|
|
66
|
+
<div className={`${prefix}--language-switcher--wrap`}>
|
|
67
|
+
{mainlink && (
|
|
68
|
+
<span className={`${prefix}--language-switcher--link--wrap`}>
|
|
69
|
+
<a
|
|
70
|
+
href={mainlink.url}
|
|
71
|
+
className={`${prefix}--language-switcher--link`}
|
|
72
|
+
>
|
|
73
|
+
{mainlink.label}
|
|
74
|
+
</a>
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
<button
|
|
78
|
+
className={`${prefix}--language-switcher--button`}
|
|
79
|
+
type="button"
|
|
80
|
+
>
|
|
81
|
+
{languagelabel}
|
|
82
|
+
</button>
|
|
83
|
+
<ContextMenu links={languagecontextmenu?.links}></ContextMenu>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<button className={`${baseClass}--menu`} onClick={handleMenuToggle}>
|
|
87
|
+
Menu
|
|
88
|
+
</button>
|
|
89
|
+
<div className={`${baseClass}--navigation`}>
|
|
90
|
+
<div className={`${baseClass}--inner`}>
|
|
91
|
+
<div className={`${prefix}--mobile--nav`}>
|
|
92
|
+
<div className={`${prefix}--mobile--nav--logo`}>
|
|
93
|
+
<a href={siteurl} className={`${baseClass}--logo-link`}>
|
|
94
|
+
<img
|
|
95
|
+
className={`${baseClass}--logo`}
|
|
96
|
+
src={logo}
|
|
97
|
+
alt="ILO Logo"
|
|
98
|
+
/>
|
|
99
|
+
</a>
|
|
100
|
+
<button
|
|
101
|
+
className={`${baseClass}--menu--close`}
|
|
102
|
+
onClick={handleMenuToggle}
|
|
103
|
+
>
|
|
104
|
+
{menucloselabel}
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
<div className={`${prefix}--mobile--nav--language--switcher`}>
|
|
108
|
+
<button
|
|
109
|
+
className={`${prefix}--mobile--nav--language--switcher--button`}
|
|
110
|
+
onClick={handleLanguageToggle}
|
|
111
|
+
type="button"
|
|
112
|
+
>
|
|
113
|
+
{languagelabel}
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
<div className={`${prefix}--mobile--nav--language--select`}>
|
|
117
|
+
<div className={`${baseClass}--inner`}>
|
|
118
|
+
<div className={`${prefix}--mobile--subnav--menu`}>
|
|
119
|
+
<button
|
|
120
|
+
className={`${prefix}--mobile--subnav--back`}
|
|
121
|
+
onClick={handleLanguageToggle}
|
|
122
|
+
type="button"
|
|
123
|
+
></button>
|
|
124
|
+
<button
|
|
125
|
+
className={`${baseClass}--menu--close`}
|
|
126
|
+
onClick={handleMenuToggle}
|
|
127
|
+
>
|
|
128
|
+
Close
|
|
129
|
+
</button>
|
|
130
|
+
<h6 className={`${prefix}--mobile--subnav--label`}>
|
|
131
|
+
{languagelabel}
|
|
132
|
+
</h6>
|
|
133
|
+
</div>
|
|
134
|
+
<ul className={`${prefix}--nav--set`}>
|
|
135
|
+
{languagecontextmenu?.links &&
|
|
136
|
+
languagecontextmenu.links.map((item, index) => (
|
|
137
|
+
<li className={`${prefix}--nav--items`} key={index}>
|
|
138
|
+
<a
|
|
139
|
+
href={item.url}
|
|
140
|
+
className={`${prefix}--nav--link ${prefix}--nav--language`}
|
|
141
|
+
>
|
|
142
|
+
{item.label}
|
|
143
|
+
</a>
|
|
144
|
+
</li>
|
|
145
|
+
))}
|
|
146
|
+
</ul>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<nav
|
|
151
|
+
className={`${prefix}--nav`}
|
|
152
|
+
aria-labelledby="primary-navigation"
|
|
153
|
+
>
|
|
154
|
+
<h2 className={`${prefix}--nav--label`} id="primary-navigation">
|
|
155
|
+
{primarynav?.navlabel}
|
|
156
|
+
</h2>
|
|
157
|
+
<ul className={`${prefix}--nav--set`}>
|
|
158
|
+
{primarynav?.items &&
|
|
159
|
+
primarynav.items.map((item, index) => (
|
|
160
|
+
<li className={`${prefix}--nav--items`} key={index}>
|
|
161
|
+
<a href={item.url} className={`${prefix}--nav--link`}>
|
|
162
|
+
{item.label}
|
|
163
|
+
</a>
|
|
164
|
+
</li>
|
|
165
|
+
))}
|
|
166
|
+
</ul>
|
|
167
|
+
</nav>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</header>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export default LocalNav;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LocalNav } from "./LocalNav";
|
package/src/components/index.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -48,3 +48,4 @@ export type NotificationTypes = "error" | "info" | "success" | "warning";
|
|
|
48
48
|
export type PositionTypes = "top" | "bottom" | "left" | "right";
|
|
49
49
|
export type SizeTypes = "small" | "medium" | "large";
|
|
50
50
|
export type TagTypes = "anchor" | "display" | "button";
|
|
51
|
+
export type SocialTypes = "instagram" | "facebook" | "twitter" | "youtube";
|