@ilo-org/react 0.5.1 → 0.6.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 +16 -0
- package/lib/cjs/components/Footer/Footer.js +4 -3
- package/lib/cjs/components/Footer/index.js +2 -0
- package/lib/cjs/components/SocialMedia/SocialMedia.js +25 -0
- package/lib/cjs/components/SocialMedia/index.js +57 -0
- package/lib/cjs/components/index.js +2 -0
- package/lib/cjs/index.js +2 -0
- package/lib/esm/components/Footer/Footer.js +5 -4
- package/lib/esm/components/Footer/index.js +2 -0
- package/lib/esm/components/SocialMedia/SocialMedia.js +23 -0
- package/lib/esm/components/SocialMedia/index.js +54 -0
- package/lib/esm/components/index.js +2 -0
- package/lib/esm/index.js +2 -0
- package/lib/types/react/src/components/Footer/Footer.props.d.ts +2 -23
- package/lib/types/react/src/components/SocialMedia/SocialMedia.args.d.ts +4 -0
- package/lib/types/react/src/components/SocialMedia/SocialMedia.d.ts +3 -0
- package/lib/types/react/src/components/SocialMedia/SocialMedia.props.d.ts +37 -0
- package/lib/types/react/src/components/SocialMedia/index.d.ts +3 -0
- package/lib/types/react/src/types/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/Footer/Footer.args.ts +2 -21
- package/src/components/Footer/Footer.props.ts +2 -26
- package/src/components/Footer/Footer.tsx +7 -19
- package/src/components/SocialMedia/SocialMedia.args.ts +54 -0
- package/src/components/SocialMedia/SocialMedia.props.ts +45 -0
- package/src/components/SocialMedia/SocialMedia.tsx +46 -0
- package/src/components/SocialMedia/index.ts +3 -0
- package/src/types/index.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ilo-org/react
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0f45a7aae: Add Social Media component and use in Footer
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0f45a7aae]
|
|
12
|
+
- Updated dependencies [0f45a7aae]
|
|
13
|
+
- Updated dependencies [0f45a7aae]
|
|
14
|
+
- Updated dependencies [2f6b0e73f]
|
|
15
|
+
- @ilo-org/themes@0.2.0
|
|
16
|
+
- @ilo-org/styles@0.5.0
|
|
17
|
+
- @ilo-org/icons-react@0.0.21
|
|
18
|
+
|
|
3
19
|
## 0.5.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -5,6 +5,8 @@ var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
|
5
5
|
var classNames = require('classnames');
|
|
6
6
|
var components_LinkList_LinkList = require('../LinkList/LinkList.js');
|
|
7
7
|
var components_Button_Button = require('../Button/Button.js');
|
|
8
|
+
var components_SocialMedia_SocialMedia = require('../SocialMedia/SocialMedia.js');
|
|
9
|
+
require('../SocialMedia/index.js');
|
|
8
10
|
require('tslib');
|
|
9
11
|
require('react');
|
|
10
12
|
require('../../GlobalCtx-97e4b433.js');
|
|
@@ -12,12 +14,11 @@ require('../Link/Link.js');
|
|
|
12
14
|
require('../Icon/Icon.js');
|
|
13
15
|
require('@ilo-org/icons-react');
|
|
14
16
|
|
|
15
|
-
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup,
|
|
17
|
+
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup, socialmedia, subscribe, legal, secondarylinks, anchorlink, }) => {
|
|
16
18
|
const { prefix } = hooks_useGlobalSettings();
|
|
17
19
|
const baseClass = `${prefix}--footer`;
|
|
18
20
|
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" }) }))), (
|
|
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
|
+
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" }) }))), (socialmedia || subscribe) && (jsxRuntime.jsxs("div", Object.assign({ className: "connect" }, { children: [socialmedia && (jsxRuntime.jsx("div", Object.assign({ className: "social--links" }, { children: jsxRuntime.jsx(components_SocialMedia_SocialMedia, Object.assign({}, socialmedia, { theme: "dark" })) }))), 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
|
};
|
|
22
23
|
|
|
23
24
|
module.exports = Footer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var classNames = require('classnames');
|
|
5
|
+
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
9
|
+
|
|
10
|
+
const SocialMedia = ({ className, theme = "light", justify = "start", headline, icons, }) => {
|
|
11
|
+
const { prefix } = hooks_useGlobalSettings();
|
|
12
|
+
// Classes to be applied to the outer element
|
|
13
|
+
const baseClass = `${prefix}--social-media`;
|
|
14
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
15
|
+
const justifyClass = `${baseClass}__justify__${justify}`;
|
|
16
|
+
const classes = classNames(baseClass, themeClass, justifyClass, className);
|
|
17
|
+
// Classes to be applied to inner elements
|
|
18
|
+
const headlineClass = `${baseClass}--headline`;
|
|
19
|
+
const listClass = `${baseClass}--list`;
|
|
20
|
+
const listItemClass = `${listClass}--item`;
|
|
21
|
+
const iconClass = `${listItemClass}--icon`;
|
|
22
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: classes }, { children: [headline && jsxRuntime.jsx("h5", Object.assign({ className: headlineClass }, { children: headline })), jsxRuntime.jsx("ul", Object.assign({ className: listClass }, { children: icons.map((item) => (jsxRuntime.jsx("li", Object.assign({ className: listItemClass }, { children: jsxRuntime.jsx("a", Object.assign({ title: item.label, className: classNames(iconClass, `${iconClass}__${item.icon}`), href: item.url }, { children: item.label })) })))) }))] })));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
module.exports = SocialMedia;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_SocialMedia_SocialMedia = require('./SocialMedia.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('classnames');
|
|
6
|
+
require('../../hooks/useGlobalSettings.js');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('react');
|
|
9
|
+
require('../../GlobalCtx-97e4b433.js');
|
|
10
|
+
|
|
11
|
+
const defaultArgs = {
|
|
12
|
+
headline: "Follow us on social media",
|
|
13
|
+
theme: "light",
|
|
14
|
+
justify: "start",
|
|
15
|
+
icons: [
|
|
16
|
+
{
|
|
17
|
+
icon: "facebook",
|
|
18
|
+
url: "https://www.facebook.com/ilo.org",
|
|
19
|
+
label: "Facebook",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
icon: "twitter",
|
|
23
|
+
url: "https://twitter.com/#!/ilo",
|
|
24
|
+
label: "Twitter",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
icon: "instagram",
|
|
28
|
+
url: "https://www.instagram.com/ilo.org/",
|
|
29
|
+
label: "Instagram",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
icon: "linkedin",
|
|
33
|
+
url: "https://www.linkedin.com/company/international-labour-organization-ilo",
|
|
34
|
+
label: "LinkedIn",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
icon: "youtube",
|
|
38
|
+
url: "https://www.youtube.com/channel/UCQsVmhSa4X-G3lHlUtejzLA",
|
|
39
|
+
label: "YouTube",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
icon: "tiktok",
|
|
43
|
+
url: "https://www.tiktok.com/@ilo",
|
|
44
|
+
label: "TikTok",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
icon: "flickr",
|
|
48
|
+
url: "https://www.flickr.com/photos/ilopictures/albums",
|
|
49
|
+
label: "TikTok",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
Object.assign(Object.assign({}, defaultArgs), { theme: "dark" });
|
|
54
|
+
Object.assign(Object.assign({}, defaultArgs), { justify: "center" });
|
|
55
|
+
|
|
56
|
+
exports.SocialMedia = components_SocialMedia_SocialMedia;
|
|
57
|
+
exports.defaultArgs = defaultArgs;
|
|
@@ -72,6 +72,8 @@ require('../VideoPlayer-d576de50.js');
|
|
|
72
72
|
require('../utils/hoursMinutesSeconds.js');
|
|
73
73
|
require('screenfull');
|
|
74
74
|
require('@ilo-org/icons-react');
|
|
75
|
+
require('./SocialMedia/SocialMedia.js');
|
|
76
|
+
require('./SocialMedia/index.js');
|
|
75
77
|
require('./Logo/Logo.js');
|
|
76
78
|
require('./List/ListItem.js');
|
|
77
79
|
|
package/lib/cjs/index.js
CHANGED
|
@@ -72,6 +72,8 @@ require('./components/Hero/HeroCard.js');
|
|
|
72
72
|
require('./VideoPlayer-d576de50.js');
|
|
73
73
|
require('./utils/hoursMinutesSeconds.js');
|
|
74
74
|
require('screenfull');
|
|
75
|
+
require('./components/SocialMedia/SocialMedia.js');
|
|
76
|
+
require('./components/SocialMedia/index.js');
|
|
75
77
|
require('./components/Logo/Logo.js');
|
|
76
78
|
require('./components/List/ListItem.js');
|
|
77
79
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsxs, jsx
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import LinkList from '../LinkList/LinkList.js';
|
|
5
5
|
import Button from '../Button/Button.js';
|
|
6
|
+
import SocialMedia from '../SocialMedia/SocialMedia.js';
|
|
7
|
+
import '../SocialMedia/index.js';
|
|
6
8
|
import 'tslib';
|
|
7
9
|
import 'react';
|
|
8
10
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
@@ -10,12 +12,11 @@ import '../Link/Link.js';
|
|
|
10
12
|
import '../Icon/Icon.js';
|
|
11
13
|
import '@ilo-org/icons-react';
|
|
12
14
|
|
|
13
|
-
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup,
|
|
15
|
+
const Footer = ({ className, logo, tagline, subtagline, address, linkgroup, socialmedia, subscribe, legal, secondarylinks, anchorlink, }) => {
|
|
14
16
|
const { prefix } = useGlobalSettings();
|
|
15
17
|
const baseClass = `${prefix}--footer`;
|
|
16
18
|
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" }) }))), (
|
|
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
|
+
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" }) }))), (socialmedia || subscribe) && (jsxs("div", Object.assign({ className: "connect" }, { children: [socialmedia && (jsx("div", Object.assign({ className: "social--links" }, { children: jsx(SocialMedia, Object.assign({}, socialmedia, { theme: "dark" })) }))), 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
|
};
|
|
20
21
|
|
|
21
22
|
export { Footer as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
7
|
+
|
|
8
|
+
const SocialMedia = ({ className, theme = "light", justify = "start", headline, icons, }) => {
|
|
9
|
+
const { prefix } = useGlobalSettings();
|
|
10
|
+
// Classes to be applied to the outer element
|
|
11
|
+
const baseClass = `${prefix}--social-media`;
|
|
12
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
13
|
+
const justifyClass = `${baseClass}__justify__${justify}`;
|
|
14
|
+
const classes = classNames(baseClass, themeClass, justifyClass, className);
|
|
15
|
+
// Classes to be applied to inner elements
|
|
16
|
+
const headlineClass = `${baseClass}--headline`;
|
|
17
|
+
const listClass = `${baseClass}--list`;
|
|
18
|
+
const listItemClass = `${listClass}--item`;
|
|
19
|
+
const iconClass = `${listItemClass}--icon`;
|
|
20
|
+
return (jsxs("div", Object.assign({ className: classes }, { children: [headline && jsx("h5", Object.assign({ className: headlineClass }, { children: headline })), jsx("ul", Object.assign({ className: listClass }, { children: icons.map((item) => (jsx("li", Object.assign({ className: listItemClass }, { children: jsx("a", Object.assign({ title: item.label, className: classNames(iconClass, `${iconClass}__${item.icon}`), href: item.url }, { children: item.label })) })))) }))] })));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { SocialMedia as default };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { default as SocialMedia } from './SocialMedia.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'classnames';
|
|
4
|
+
import '../../hooks/useGlobalSettings.js';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
8
|
+
|
|
9
|
+
const defaultArgs = {
|
|
10
|
+
headline: "Follow us on social media",
|
|
11
|
+
theme: "light",
|
|
12
|
+
justify: "start",
|
|
13
|
+
icons: [
|
|
14
|
+
{
|
|
15
|
+
icon: "facebook",
|
|
16
|
+
url: "https://www.facebook.com/ilo.org",
|
|
17
|
+
label: "Facebook",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
icon: "twitter",
|
|
21
|
+
url: "https://twitter.com/#!/ilo",
|
|
22
|
+
label: "Twitter",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
icon: "instagram",
|
|
26
|
+
url: "https://www.instagram.com/ilo.org/",
|
|
27
|
+
label: "Instagram",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
icon: "linkedin",
|
|
31
|
+
url: "https://www.linkedin.com/company/international-labour-organization-ilo",
|
|
32
|
+
label: "LinkedIn",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
icon: "youtube",
|
|
36
|
+
url: "https://www.youtube.com/channel/UCQsVmhSa4X-G3lHlUtejzLA",
|
|
37
|
+
label: "YouTube",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
icon: "tiktok",
|
|
41
|
+
url: "https://www.tiktok.com/@ilo",
|
|
42
|
+
label: "TikTok",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
icon: "flickr",
|
|
46
|
+
url: "https://www.flickr.com/photos/ilopictures/albums",
|
|
47
|
+
label: "TikTok",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
Object.assign(Object.assign({}, defaultArgs), { theme: "dark" });
|
|
52
|
+
Object.assign(Object.assign({}, defaultArgs), { justify: "center" });
|
|
53
|
+
|
|
54
|
+
export { defaultArgs };
|
|
@@ -70,5 +70,7 @@ import '../VideoPlayer-a5fa87ce.js';
|
|
|
70
70
|
import '../utils/hoursMinutesSeconds.js';
|
|
71
71
|
import 'screenfull';
|
|
72
72
|
import '@ilo-org/icons-react';
|
|
73
|
+
import './SocialMedia/SocialMedia.js';
|
|
74
|
+
import './SocialMedia/index.js';
|
|
73
75
|
import './Logo/Logo.js';
|
|
74
76
|
import './List/ListItem.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -70,5 +70,7 @@ import './components/Hero/HeroCard.js';
|
|
|
70
70
|
import './VideoPlayer-a5fa87ce.js';
|
|
71
71
|
import './utils/hoursMinutesSeconds.js';
|
|
72
72
|
import 'screenfull';
|
|
73
|
+
import './components/SocialMedia/SocialMedia.js';
|
|
74
|
+
import './components/SocialMedia/index.js';
|
|
73
75
|
import './components/Logo/Logo.js';
|
|
74
76
|
import './components/List/ListItem.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LinkGroupProps } from "../LinkList/LinkList.props";
|
|
2
2
|
import { LinkProps } from "../LinkList/LinkList.props";
|
|
3
|
-
import {
|
|
3
|
+
import { SocialMediaProps } from "../SocialMedia";
|
|
4
4
|
export interface FooterProps {
|
|
5
5
|
/**
|
|
6
6
|
* Specify an optional className to be added to your Footer.
|
|
@@ -29,7 +29,7 @@ export interface FooterProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Specify the links to be displayed in this link group
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
socialmedia?: SocialMediaProps;
|
|
33
33
|
/**
|
|
34
34
|
* Specify the legal statement for the Footer
|
|
35
35
|
*/
|
|
@@ -47,24 +47,3 @@ export interface FooterProps {
|
|
|
47
47
|
*/
|
|
48
48
|
anchorlink?: LinkProps;
|
|
49
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,37 @@
|
|
|
1
|
+
import { SocialTypes } from "../../types";
|
|
2
|
+
export interface SocialMediaIcons {
|
|
3
|
+
/**
|
|
4
|
+
* The name of the icon to display
|
|
5
|
+
*/
|
|
6
|
+
icon: SocialTypes;
|
|
7
|
+
/**
|
|
8
|
+
* The url to link to
|
|
9
|
+
*/
|
|
10
|
+
url: string;
|
|
11
|
+
/**
|
|
12
|
+
* The alt text of the link
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SocialMediaProps {
|
|
17
|
+
/**
|
|
18
|
+
* An optional headline to display above the icons
|
|
19
|
+
*/
|
|
20
|
+
headline?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Specify an optional className to be added to your SocialMedia.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Specify the theme of the SocialMedia.
|
|
27
|
+
*/
|
|
28
|
+
theme?: "light" | "dark";
|
|
29
|
+
/**
|
|
30
|
+
* The justification of the icons
|
|
31
|
+
*/
|
|
32
|
+
justify?: "start" | "center";
|
|
33
|
+
/**
|
|
34
|
+
* Specify the icons to display.
|
|
35
|
+
*/
|
|
36
|
+
icons: SocialMediaIcons[];
|
|
37
|
+
}
|
|
@@ -25,7 +25,7 @@ export type NotificationTypes = "error" | "info" | "success" | "warning";
|
|
|
25
25
|
export type PositionTypes = "top" | "bottom" | "left" | "right";
|
|
26
26
|
export type SizeTypes = "small" | "medium" | "large";
|
|
27
27
|
export type TagTypes = "anchor" | "display" | "button";
|
|
28
|
-
export type SocialTypes = "
|
|
28
|
+
export type SocialTypes = "facebook" | "twitter" | "instagram" | "linkedin" | "youtube" | "tiktok" | "flickr";
|
|
29
29
|
export type CardColor = "turquoise" | "green" | "yellow" | "blue";
|
|
30
30
|
export type CardSize = "wide" | "standard" | "narrow";
|
|
31
31
|
export type CardCornerType = "cornercut" | "corner";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "React components for the ILO's Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui_patterns",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"react-transition-group": "^4.4.1",
|
|
75
75
|
"@ilo-org/brand-assets": "0.1.0",
|
|
76
76
|
"@ilo-org/fonts": "0.1.0",
|
|
77
|
-
"@ilo-org/icons-react": "0.0.
|
|
78
|
-
"@ilo-org/styles": "0.
|
|
79
|
-
"@ilo-org/themes": "0.
|
|
77
|
+
"@ilo-org/icons-react": "0.0.21",
|
|
78
|
+
"@ilo-org/styles": "0.5.0",
|
|
79
|
+
"@ilo-org/themes": "0.2.0",
|
|
80
80
|
"@ilo-org/utils": "0.0.11"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FooterProps } from "./Footer.props";
|
|
2
2
|
import ilo_logo_white from "@ilo-org/brand-assets/logo_en_horizontal_white.svg";
|
|
3
|
+
import { darkArgs as socialMediaArgs } from "../SocialMedia/SocialMedia.args";
|
|
3
4
|
|
|
4
5
|
const basic: FooterProps = {
|
|
5
6
|
className: "footer",
|
|
@@ -42,27 +43,7 @@ const basic: FooterProps = {
|
|
|
42
43
|
],
|
|
43
44
|
},
|
|
44
45
|
],
|
|
45
|
-
|
|
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
|
-
},
|
|
46
|
+
socialmedia: socialMediaArgs,
|
|
66
47
|
subscribe: {
|
|
67
48
|
label: "Subscribe",
|
|
68
49
|
url: "https://www.ilo.org",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LinkGroupProps } from "../LinkList/LinkList.props";
|
|
2
2
|
import { LinkProps } from "../LinkList/LinkList.props";
|
|
3
|
-
import {
|
|
3
|
+
import { SocialMediaProps } from "../SocialMedia";
|
|
4
4
|
|
|
5
5
|
export interface FooterProps {
|
|
6
6
|
/**
|
|
@@ -36,7 +36,7 @@ export interface FooterProps {
|
|
|
36
36
|
/**
|
|
37
37
|
* Specify the links to be displayed in this link group
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
socialmedia?: SocialMediaProps;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Specify the legal statement for the Footer
|
|
@@ -58,27 +58,3 @@ export interface FooterProps {
|
|
|
58
58
|
*/
|
|
59
59
|
anchorlink?: LinkProps;
|
|
60
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
|
-
}
|
|
@@ -4,6 +4,7 @@ import classnames from "classnames";
|
|
|
4
4
|
import { FooterProps } from "./Footer.props";
|
|
5
5
|
import { LinkList } from "../LinkList";
|
|
6
6
|
import { Button } from "../Button";
|
|
7
|
+
import { SocialMedia } from "../SocialMedia";
|
|
7
8
|
|
|
8
9
|
const Footer: FC<FooterProps> = ({
|
|
9
10
|
className,
|
|
@@ -12,7 +13,7 @@ const Footer: FC<FooterProps> = ({
|
|
|
12
13
|
subtagline,
|
|
13
14
|
address,
|
|
14
15
|
linkgroup,
|
|
15
|
-
|
|
16
|
+
socialmedia,
|
|
16
17
|
subscribe,
|
|
17
18
|
legal,
|
|
18
19
|
secondarylinks,
|
|
@@ -45,25 +46,12 @@ const Footer: FC<FooterProps> = ({
|
|
|
45
46
|
<LinkList linkgroup={linkgroup} theme="dark"></LinkList>
|
|
46
47
|
</nav>
|
|
47
48
|
)}
|
|
48
|
-
{(
|
|
49
|
+
{(socialmedia || subscribe) && (
|
|
49
50
|
<div className="connect">
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
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
|
-
</>
|
|
51
|
+
{socialmedia && (
|
|
52
|
+
<div className="social--links">
|
|
53
|
+
<SocialMedia {...socialmedia} theme="dark" />
|
|
54
|
+
</div>
|
|
67
55
|
)}
|
|
68
56
|
{subscribe && (
|
|
69
57
|
<Button
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SocialMediaProps } from "./SocialMedia.props";
|
|
2
|
+
|
|
3
|
+
export const defaultArgs: SocialMediaProps = {
|
|
4
|
+
headline: "Follow us on social media",
|
|
5
|
+
theme: "light",
|
|
6
|
+
justify: "start",
|
|
7
|
+
icons: [
|
|
8
|
+
{
|
|
9
|
+
icon: "facebook",
|
|
10
|
+
url: "https://www.facebook.com/ilo.org",
|
|
11
|
+
label: "Facebook",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
icon: "twitter",
|
|
15
|
+
url: "https://twitter.com/#!/ilo",
|
|
16
|
+
label: "Twitter",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
icon: "instagram",
|
|
20
|
+
url: "https://www.instagram.com/ilo.org/",
|
|
21
|
+
label: "Instagram",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
icon: "linkedin",
|
|
25
|
+
url: "https://www.linkedin.com/company/international-labour-organization-ilo",
|
|
26
|
+
label: "LinkedIn",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
icon: "youtube",
|
|
30
|
+
url: "https://www.youtube.com/channel/UCQsVmhSa4X-G3lHlUtejzLA",
|
|
31
|
+
label: "YouTube",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
icon: "tiktok",
|
|
35
|
+
url: "https://www.tiktok.com/@ilo",
|
|
36
|
+
label: "TikTok",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
icon: "flickr",
|
|
40
|
+
url: "https://www.flickr.com/photos/ilopictures/albums",
|
|
41
|
+
label: "TikTok",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const darkArgs: SocialMediaProps = {
|
|
47
|
+
...defaultArgs,
|
|
48
|
+
theme: "dark",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const centredArgs: SocialMediaProps = {
|
|
52
|
+
...defaultArgs,
|
|
53
|
+
justify: "center",
|
|
54
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SocialTypes } from "../../types";
|
|
2
|
+
|
|
3
|
+
export interface SocialMediaIcons {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the icon to display
|
|
6
|
+
*/
|
|
7
|
+
icon: SocialTypes;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The url to link to
|
|
11
|
+
*/
|
|
12
|
+
url: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The alt text of the link
|
|
16
|
+
*/
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SocialMediaProps {
|
|
21
|
+
/**
|
|
22
|
+
* An optional headline to display above the icons
|
|
23
|
+
*/
|
|
24
|
+
headline?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Specify an optional className to be added to your SocialMedia.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specify the theme of the SocialMedia.
|
|
33
|
+
*/
|
|
34
|
+
theme?: "light" | "dark";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The justification of the icons
|
|
38
|
+
*/
|
|
39
|
+
justify?: "start" | "center";
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Specify the icons to display.
|
|
43
|
+
*/
|
|
44
|
+
icons: SocialMediaIcons[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import classnames from "classnames";
|
|
2
|
+
import { useGlobalSettings } from "../../hooks";
|
|
3
|
+
import { SocialMediaProps } from "./SocialMedia.props";
|
|
4
|
+
|
|
5
|
+
const SocialMedia: React.FC<SocialMediaProps> = ({
|
|
6
|
+
className,
|
|
7
|
+
theme = "light",
|
|
8
|
+
justify = "start",
|
|
9
|
+
headline,
|
|
10
|
+
icons,
|
|
11
|
+
}) => {
|
|
12
|
+
const { prefix } = useGlobalSettings();
|
|
13
|
+
|
|
14
|
+
// Classes to be applied to the outer element
|
|
15
|
+
const baseClass = `${prefix}--social-media`;
|
|
16
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
17
|
+
const justifyClass = `${baseClass}__justify__${justify}`;
|
|
18
|
+
const classes = classnames(baseClass, themeClass, justifyClass, className);
|
|
19
|
+
|
|
20
|
+
// Classes to be applied to inner elements
|
|
21
|
+
const headlineClass = `${baseClass}--headline`;
|
|
22
|
+
const listClass = `${baseClass}--list`;
|
|
23
|
+
const listItemClass = `${listClass}--item`;
|
|
24
|
+
const iconClass = `${listItemClass}--icon`;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className={classes}>
|
|
28
|
+
{headline && <h5 className={headlineClass}>{headline}</h5>}
|
|
29
|
+
<ul className={listClass}>
|
|
30
|
+
{icons.map((item) => (
|
|
31
|
+
<li className={listItemClass}>
|
|
32
|
+
<a
|
|
33
|
+
title={item.label}
|
|
34
|
+
className={classnames(iconClass, `${iconClass}__${item.icon}`)}
|
|
35
|
+
href={item.url}
|
|
36
|
+
>
|
|
37
|
+
{item.label}
|
|
38
|
+
</a>
|
|
39
|
+
</li>
|
|
40
|
+
))}
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default SocialMedia;
|
package/src/types/index.ts
CHANGED
|
@@ -49,7 +49,14 @@ export type NotificationTypes = "error" | "info" | "success" | "warning";
|
|
|
49
49
|
export type PositionTypes = "top" | "bottom" | "left" | "right";
|
|
50
50
|
export type SizeTypes = "small" | "medium" | "large";
|
|
51
51
|
export type TagTypes = "anchor" | "display" | "button";
|
|
52
|
-
export type SocialTypes =
|
|
52
|
+
export type SocialTypes =
|
|
53
|
+
| "facebook"
|
|
54
|
+
| "twitter"
|
|
55
|
+
| "instagram"
|
|
56
|
+
| "linkedin"
|
|
57
|
+
| "youtube"
|
|
58
|
+
| "tiktok"
|
|
59
|
+
| "flickr";
|
|
53
60
|
export type CardColor = "turquoise" | "green" | "yellow" | "blue";
|
|
54
61
|
export type CardSize = "wide" | "standard" | "narrow";
|
|
55
62
|
export type CardCornerType = "cornercut" | "corner";
|