@ilo-org/react 0.5.1 → 0.7.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 +30 -0
- package/lib/cjs/components/Accordion/AccordionPanel.js +3 -3
- package/lib/cjs/components/Footer/Footer.js +4 -3
- package/lib/cjs/components/Footer/index.js +2 -0
- package/lib/cjs/components/Hero/Hero.js +21 -11
- package/lib/cjs/components/Hero/HeroCard.js +20 -10
- package/lib/cjs/components/Hero/index.js +6 -2
- package/lib/cjs/components/LogoGrid/LogoGrid.js +30 -0
- package/lib/cjs/components/LogoGrid/index.js +13 -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/Accordion/AccordionPanel.js +3 -3
- package/lib/esm/components/Footer/Footer.js +5 -4
- package/lib/esm/components/Footer/index.js +2 -0
- package/lib/esm/components/Hero/Hero.js +22 -12
- package/lib/esm/components/Hero/HeroCard.js +20 -10
- package/lib/esm/components/Hero/index.js +6 -2
- package/lib/esm/components/LogoGrid/LogoGrid.js +28 -0
- package/lib/esm/components/LogoGrid/index.js +7 -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/Accordion/AccordionPanel.props.d.ts +4 -0
- package/lib/types/react/src/components/Card/Card.props.d.ts +2 -2
- package/lib/types/react/src/components/Footer/Footer.props.d.ts +2 -23
- package/lib/types/react/src/components/Hero/Hero.props.d.ts +28 -6
- package/lib/types/react/src/components/Hero/HeroCard.props.d.ts +13 -23
- package/lib/types/react/src/components/Image/Image.props.d.ts +7 -3
- package/lib/types/react/src/components/LogoGrid/LogoGrid.d.ts +4 -0
- package/lib/types/react/src/components/LogoGrid/LogoGrid.props.d.ts +24 -0
- package/lib/types/react/src/components/LogoGrid/index.d.ts +1 -0
- 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 +2 -4
- package/package.json +4 -4
- package/public/fao-logo.svg +195 -0
- package/public/unhcr-logo.svg +1 -0
- package/public/unicef-logo.png +0 -0
- package/public/wfp-logo.svg +1 -0
- package/public/who-logo.svg +1 -0
- package/src/components/Accordion/AccordionPanel.props.ts +5 -0
- package/src/components/Accordion/AccordionPanel.tsx +3 -3
- package/src/components/Card/Card.props.ts +2 -2
- 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/Hero/Hero.args.ts +84 -270
- package/src/components/Hero/Hero.props.ts +33 -6
- package/src/components/Hero/Hero.tsx +66 -18
- package/src/components/Hero/HeroCard.props.ts +14 -25
- package/src/components/Hero/HeroCard.tsx +45 -33
- package/src/components/Image/Image.props.ts +8 -3
- package/src/components/LogoGrid/LogoGrid.args.ts +50 -0
- package/src/components/LogoGrid/LogoGrid.props.ts +28 -0
- package/src/components/LogoGrid/LogoGrid.tsx +53 -0
- package/src/components/LogoGrid/index.ts +1 -0
- 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 +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @ilo-org/react
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c0648530f: Accordion items can now be made scrollable by passing `scroll: true` to the Accordion Panel component.
|
|
8
|
+
- 0dc9a8538: Add LogoGrid component which shows a list of logos with an optional link
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 77517f4dc: Refactor Hero and HeroCard to sync with new implemenation in Twig and Styles packages
|
|
13
|
+
- Updated dependencies [c0648530f]
|
|
14
|
+
- Updated dependencies [0dc9a8538]
|
|
15
|
+
- @ilo-org/styles@0.6.0
|
|
16
|
+
|
|
17
|
+
## 0.6.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 0f45a7aae: Add Social Media component and use in Footer
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [0f45a7aae]
|
|
26
|
+
- Updated dependencies [0f45a7aae]
|
|
27
|
+
- Updated dependencies [0f45a7aae]
|
|
28
|
+
- Updated dependencies [2f6b0e73f]
|
|
29
|
+
- @ilo-org/themes@0.2.0
|
|
30
|
+
- @ilo-org/styles@0.5.0
|
|
31
|
+
- @ilo-org/icons-react@0.0.21
|
|
32
|
+
|
|
3
33
|
## 0.5.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -9,15 +9,15 @@ var AccordionCtx = require('../../AccordionCtx-fe08ff45.js');
|
|
|
9
9
|
require('../../GlobalCtx-97e4b433.js');
|
|
10
10
|
|
|
11
11
|
const AccordionPanel = (_a) => {
|
|
12
|
-
var { children, className,
|
|
12
|
+
var { children, className, scroll } = _a, rest = tslib.__rest(_a, ["children", "className", "scroll"]);
|
|
13
13
|
const { activeItems } = require$$0.useContext(AccordionCtx.AccordionContext);
|
|
14
14
|
const { id } = require$$0.useContext(AccordionCtx.AccordionItemContext);
|
|
15
15
|
const [panelHeight, setPanelHeight] = require$$0.useState(0);
|
|
16
16
|
const open = activeItems.indexOf(id) > -1;
|
|
17
17
|
const { prefix } = hooks_useGlobalSettings();
|
|
18
18
|
const baseClass = `${prefix}--accordion--panel`;
|
|
19
|
-
const accordionaPanelClasses = classNames(className, {
|
|
20
|
-
[baseClass]:
|
|
19
|
+
const accordionaPanelClasses = classNames(className, baseClass, {
|
|
20
|
+
[`${baseClass}__scroll`]: scroll,
|
|
21
21
|
[`${baseClass}--open`]: open,
|
|
22
22
|
});
|
|
23
23
|
const ref = require$$0.useRef();
|
|
@@ -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;
|
|
@@ -4,22 +4,32 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
6
|
var components_Hero_HeroCard = require('./HeroCard.js');
|
|
7
|
-
var
|
|
7
|
+
var components_Breadcrumb_Breadcrumb = require('../Breadcrumb/Breadcrumb.js');
|
|
8
|
+
var components_Tooltip_Tooltip = require('../Tooltip/Tooltip.js');
|
|
8
9
|
require('tslib');
|
|
9
10
|
require('react');
|
|
10
11
|
require('../../GlobalCtx-97e4b433.js');
|
|
11
|
-
require('../
|
|
12
|
+
require('../SocialMedia/SocialMedia.js');
|
|
13
|
+
require('../SocialMedia/index.js');
|
|
14
|
+
require('../ContextMenu/ContextMenu.js');
|
|
15
|
+
require('react-dom');
|
|
12
16
|
|
|
13
|
-
const
|
|
17
|
+
const HeroImage = ({ url, alt }) => {
|
|
14
18
|
const { prefix } = hooks_useGlobalSettings();
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const imageClass = `${prefix}--card--image`;
|
|
20
|
+
// Sort the urls by breakpoint
|
|
21
|
+
const sortedUrls = url.sort((a, b) => a.breakpoint - b.breakpoint);
|
|
22
|
+
const defaultSrc = sortedUrls[sortedUrls.length - 1].src;
|
|
23
|
+
return (jsxRuntime.jsx("figure", Object.assign({ className: "hero--figure" }, { children: jsxRuntime.jsxs("picture", { children: [sortedUrls.map((img) => (jsxRuntime.jsx("source", { srcSet: img.src, media: `(min-width: ${img.breakpoint}px)` }, img.breakpoint))), jsxRuntime.jsx("img", { className: imageClass, src: defaultSrc, alt: alt })] }) })));
|
|
24
|
+
};
|
|
25
|
+
const Hero = ({ justify = "start", align = "baseline", cardSize = "small", posterSize = "large", image, breadcrumb, heroCard, caption, }) => {
|
|
26
|
+
const baseClass = "hero";
|
|
27
|
+
const justifyClass = `${baseClass}__card-justify__${justify}`;
|
|
28
|
+
const alignClass = `${baseClass}__card-align__${align}`;
|
|
29
|
+
const cardSizeClass = `${baseClass}__card-size__${cardSize}`;
|
|
30
|
+
const posterSizeClass = `${baseClass}__poster-size__${posterSize}`;
|
|
31
|
+
const heroClasses = classNames(baseClass, justifyClass, alignClass, cardSizeClass, posterSizeClass);
|
|
32
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: heroClasses }, { children: [image ? jsxRuntime.jsx(HeroImage, Object.assign({}, image)) : jsxRuntime.jsx("div", { className: "hero--figure" }), breadcrumb && (jsxRuntime.jsx("div", Object.assign({ className: "hero--breadcrumbs" }, { children: jsxRuntime.jsx("div", Object.assign({ className: "hero--breadcrumbs--wrapper" }, { children: jsxRuntime.jsx(components_Breadcrumb_Breadcrumb, Object.assign({}, breadcrumb)) })) }))), jsxRuntime.jsx("div", Object.assign({ className: "hero--card" }, { children: jsxRuntime.jsx(components_Hero_HeroCard, Object.assign({}, heroCard)) })), caption && (jsxRuntime.jsx("div", Object.assign({ className: "hero--caption" }, { children: jsxRuntime.jsx("div", Object.assign({ className: "hero--caption--wrapper" }, { children: jsxRuntime.jsx(components_Tooltip_Tooltip, Object.assign({}, caption)) })) })))] })));
|
|
23
33
|
};
|
|
24
34
|
|
|
25
35
|
module.exports = Hero;
|
|
@@ -3,23 +3,33 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
|
+
var components_SocialMedia_SocialMedia = require('../SocialMedia/SocialMedia.js');
|
|
7
|
+
require('../SocialMedia/index.js');
|
|
6
8
|
require('tslib');
|
|
7
9
|
require('react');
|
|
8
10
|
require('../../GlobalCtx-97e4b433.js');
|
|
9
11
|
|
|
10
|
-
const
|
|
12
|
+
const HeroCardTitle = ({ baseclass, title, url }) => {
|
|
13
|
+
const titleClass = `${baseclass}--title`;
|
|
14
|
+
const linkClass = `${baseclass}--title-link`;
|
|
15
|
+
if (!url) {
|
|
16
|
+
return jsxRuntime.jsx("h1", Object.assign({ className: titleClass }, { children: title }));
|
|
17
|
+
}
|
|
18
|
+
return (jsxRuntime.jsx("a", Object.assign({ className: linkClass, href: url }, { children: jsxRuntime.jsx("h1", Object.assign({ className: titleClass }, { children: title })) })));
|
|
19
|
+
};
|
|
20
|
+
const HeroCard = ({ theme = "dark", background = "solid", cornercut = "true", eyebrow, title, url, datecopy, intro, socialmedia, }) => {
|
|
11
21
|
const { prefix } = hooks_useGlobalSettings();
|
|
12
22
|
const baseClass = `${prefix}--hero-card`;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[
|
|
23
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
24
|
+
const backgroundClass = `${baseClass}__background__${background}`;
|
|
25
|
+
const cornercutClass = `${baseClass}__cornercut`;
|
|
26
|
+
const heroCardClasses = classNames(baseClass, themeClass, backgroundClass, {
|
|
27
|
+
[cornercutClass]: cornercut,
|
|
18
28
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const eyebrowClass = `${baseClass}--eyebrow`;
|
|
30
|
+
const datecopyClass = `${baseClass}--datecopy`;
|
|
31
|
+
const introClass = `${baseClass}--intro`;
|
|
32
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: heroCardClasses }, { children: [eyebrow && jsxRuntime.jsx("p", Object.assign({ className: eyebrowClass }, { children: eyebrow })), jsxRuntime.jsx(HeroCardTitle, { baseclass: baseClass, title: title, url: url }), datecopy && jsxRuntime.jsx("p", Object.assign({ className: datecopyClass }, { children: datecopy })), intro && jsxRuntime.jsx("p", Object.assign({ className: introClass }, { children: intro })), socialmedia && jsxRuntime.jsx(components_SocialMedia_SocialMedia, Object.assign({}, socialmedia, { theme: theme }))] })));
|
|
23
33
|
};
|
|
24
34
|
|
|
25
35
|
module.exports = HeroCard;
|
|
@@ -8,8 +8,12 @@ require('../../hooks/useGlobalSettings.js');
|
|
|
8
8
|
require('tslib');
|
|
9
9
|
require('react');
|
|
10
10
|
require('../../GlobalCtx-97e4b433.js');
|
|
11
|
-
require('../
|
|
12
|
-
require('../
|
|
11
|
+
require('../Breadcrumb/Breadcrumb.js');
|
|
12
|
+
require('../ContextMenu/ContextMenu.js');
|
|
13
|
+
require('../Tooltip/Tooltip.js');
|
|
14
|
+
require('react-dom');
|
|
15
|
+
require('../SocialMedia/SocialMedia.js');
|
|
16
|
+
require('../SocialMedia/index.js');
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
|
|
@@ -0,0 +1,30 @@
|
|
|
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 LogoGridItem = ({ url, label, src }) => {
|
|
11
|
+
const { prefix } = hooks_useGlobalSettings();
|
|
12
|
+
const itemClass = `${prefix}--logo-grid--item`;
|
|
13
|
+
const itemLinkClass = `${prefix}--logo-grid--link`;
|
|
14
|
+
const gridItemClass = classNames(itemClass, {
|
|
15
|
+
[itemLinkClass]: !!url,
|
|
16
|
+
});
|
|
17
|
+
if (!url) {
|
|
18
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: gridItemClass }, { children: jsxRuntime.jsx("img", { alt: label, src: src }) })));
|
|
19
|
+
}
|
|
20
|
+
return (jsxRuntime.jsx("a", Object.assign({ className: gridItemClass, href: url, target: "_blank", rel: "noopener noreferrer" }, { children: jsxRuntime.jsx("img", { alt: label, src: src }) })));
|
|
21
|
+
};
|
|
22
|
+
const LogoGrid = ({ logos, theme = "light" }) => {
|
|
23
|
+
const { prefix } = hooks_useGlobalSettings();
|
|
24
|
+
const baseClass = `${prefix}--logo-grid`;
|
|
25
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
26
|
+
const logoGridClass = classNames(baseClass, themeClass);
|
|
27
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: logoGridClass }, { children: jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--logos` }, { children: logos.map((logo) => (jsxRuntime.jsx(LogoGridItem, Object.assign({}, logo)))) })) })));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
module.exports = LogoGrid;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_LogoGrid_LogoGrid = require('./LogoGrid.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
|
+
|
|
12
|
+
|
|
13
|
+
exports.LogoGrid = components_LogoGrid_LogoGrid;
|
|
@@ -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;
|
|
@@ -38,6 +38,7 @@ var components_Checkbox_Checkbox = require('./Checkbox/Checkbox.js');
|
|
|
38
38
|
var components_DatePicker_DatePicker = require('./DatePicker/DatePicker.js');
|
|
39
39
|
var components_Form_Form = require('./Form/Form.js');
|
|
40
40
|
var components_Hero_Hero = require('./Hero/Hero.js');
|
|
41
|
+
require('./SocialMedia/index.js');
|
|
41
42
|
var components_LinkList_LinkList = require('./LinkList/LinkList.js');
|
|
42
43
|
var components_Pagination_Pagination = require('./Pagination/Pagination.js');
|
|
43
44
|
var components_SearchField_SearchField = require('./SearchField/SearchField.js');
|
|
@@ -68,6 +69,7 @@ require('../css-9c93400b.js');
|
|
|
68
69
|
require('../utils/transitionEndListener.js');
|
|
69
70
|
require('../utils/triggerBrowserReflow.js');
|
|
70
71
|
require('./Hero/HeroCard.js');
|
|
72
|
+
require('./SocialMedia/SocialMedia.js');
|
|
71
73
|
require('../VideoPlayer-d576de50.js');
|
|
72
74
|
require('../utils/hoursMinutesSeconds.js');
|
|
73
75
|
require('screenfull');
|
package/lib/cjs/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var components_Checkbox_Checkbox = require('./components/Checkbox/Checkbox.js');
|
|
|
38
38
|
var components_DatePicker_DatePicker = require('./components/DatePicker/DatePicker.js');
|
|
39
39
|
var components_Form_Form = require('./components/Form/Form.js');
|
|
40
40
|
var components_Hero_Hero = require('./components/Hero/Hero.js');
|
|
41
|
+
require('./components/SocialMedia/index.js');
|
|
41
42
|
var components_LinkList_LinkList = require('./components/LinkList/LinkList.js');
|
|
42
43
|
var components_Pagination_Pagination = require('./components/Pagination/Pagination.js');
|
|
43
44
|
var components_SearchField_SearchField = require('./components/SearchField/SearchField.js');
|
|
@@ -69,6 +70,7 @@ require('./utils/transitionEndListener.js');
|
|
|
69
70
|
require('./utils/triggerBrowserReflow.js');
|
|
70
71
|
require('@ilo-org/icons-react');
|
|
71
72
|
require('./components/Hero/HeroCard.js');
|
|
73
|
+
require('./components/SocialMedia/SocialMedia.js');
|
|
72
74
|
require('./VideoPlayer-d576de50.js');
|
|
73
75
|
require('./utils/hoursMinutesSeconds.js');
|
|
74
76
|
require('screenfull');
|
|
@@ -7,15 +7,15 @@ import { A as AccordionContext, a as AccordionItemContext } from '../../Accordio
|
|
|
7
7
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
8
8
|
|
|
9
9
|
const AccordionPanel = (_a) => {
|
|
10
|
-
var { children, className,
|
|
10
|
+
var { children, className, scroll } = _a, rest = __rest(_a, ["children", "className", "scroll"]);
|
|
11
11
|
const { activeItems } = useContext(AccordionContext);
|
|
12
12
|
const { id } = useContext(AccordionItemContext);
|
|
13
13
|
const [panelHeight, setPanelHeight] = useState(0);
|
|
14
14
|
const open = activeItems.indexOf(id) > -1;
|
|
15
15
|
const { prefix } = useGlobalSettings();
|
|
16
16
|
const baseClass = `${prefix}--accordion--panel`;
|
|
17
|
-
const accordionaPanelClasses = classNames(className, {
|
|
18
|
-
[baseClass]:
|
|
17
|
+
const accordionaPanelClasses = classNames(className, baseClass, {
|
|
18
|
+
[`${baseClass}__scroll`]: scroll,
|
|
19
19
|
[`${baseClass}--open`]: open,
|
|
20
20
|
});
|
|
21
21
|
const ref = useRef();
|
|
@@ -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 };
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
4
|
import HeroCard from './HeroCard.js';
|
|
5
|
-
import
|
|
5
|
+
import Breadcrumb from '../Breadcrumb/Breadcrumb.js';
|
|
6
|
+
import Tooltip from '../Tooltip/Tooltip.js';
|
|
6
7
|
import 'tslib';
|
|
7
8
|
import 'react';
|
|
8
9
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
9
|
-
import '../
|
|
10
|
+
import '../SocialMedia/SocialMedia.js';
|
|
11
|
+
import '../SocialMedia/index.js';
|
|
12
|
+
import '../ContextMenu/ContextMenu.js';
|
|
13
|
+
import 'react-dom';
|
|
10
14
|
|
|
11
|
-
const
|
|
15
|
+
const HeroImage = ({ url, alt }) => {
|
|
12
16
|
const { prefix } = useGlobalSettings();
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const imageClass = `${prefix}--card--image`;
|
|
18
|
+
// Sort the urls by breakpoint
|
|
19
|
+
const sortedUrls = url.sort((a, b) => a.breakpoint - b.breakpoint);
|
|
20
|
+
const defaultSrc = sortedUrls[sortedUrls.length - 1].src;
|
|
21
|
+
return (jsx("figure", Object.assign({ className: "hero--figure" }, { children: jsxs("picture", { children: [sortedUrls.map((img) => (jsx("source", { srcSet: img.src, media: `(min-width: ${img.breakpoint}px)` }, img.breakpoint))), jsx("img", { className: imageClass, src: defaultSrc, alt: alt })] }) })));
|
|
22
|
+
};
|
|
23
|
+
const Hero = ({ justify = "start", align = "baseline", cardSize = "small", posterSize = "large", image, breadcrumb, heroCard, caption, }) => {
|
|
24
|
+
const baseClass = "hero";
|
|
25
|
+
const justifyClass = `${baseClass}__card-justify__${justify}`;
|
|
26
|
+
const alignClass = `${baseClass}__card-align__${align}`;
|
|
27
|
+
const cardSizeClass = `${baseClass}__card-size__${cardSize}`;
|
|
28
|
+
const posterSizeClass = `${baseClass}__poster-size__${posterSize}`;
|
|
29
|
+
const heroClasses = classNames(baseClass, justifyClass, alignClass, cardSizeClass, posterSizeClass);
|
|
30
|
+
return (jsxs("div", Object.assign({ className: heroClasses }, { children: [image ? jsx(HeroImage, Object.assign({}, image)) : jsx("div", { className: "hero--figure" }), breadcrumb && (jsx("div", Object.assign({ className: "hero--breadcrumbs" }, { children: jsx("div", Object.assign({ className: "hero--breadcrumbs--wrapper" }, { children: jsx(Breadcrumb, Object.assign({}, breadcrumb)) })) }))), jsx("div", Object.assign({ className: "hero--card" }, { children: jsx(HeroCard, Object.assign({}, heroCard)) })), caption && (jsx("div", Object.assign({ className: "hero--caption" }, { children: jsx("div", Object.assign({ className: "hero--caption--wrapper" }, { children: jsx(Tooltip, Object.assign({}, caption)) })) })))] })));
|
|
21
31
|
};
|
|
22
32
|
|
|
23
33
|
export { Hero as default };
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
|
+
import SocialMedia from '../SocialMedia/SocialMedia.js';
|
|
5
|
+
import '../SocialMedia/index.js';
|
|
4
6
|
import 'tslib';
|
|
5
7
|
import 'react';
|
|
6
8
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
7
9
|
|
|
8
|
-
const
|
|
10
|
+
const HeroCardTitle = ({ baseclass, title, url }) => {
|
|
11
|
+
const titleClass = `${baseclass}--title`;
|
|
12
|
+
const linkClass = `${baseclass}--title-link`;
|
|
13
|
+
if (!url) {
|
|
14
|
+
return jsx("h1", Object.assign({ className: titleClass }, { children: title }));
|
|
15
|
+
}
|
|
16
|
+
return (jsx("a", Object.assign({ className: linkClass, href: url }, { children: jsx("h1", Object.assign({ className: titleClass }, { children: title })) })));
|
|
17
|
+
};
|
|
18
|
+
const HeroCard = ({ theme = "dark", background = "solid", cornercut = "true", eyebrow, title, url, datecopy, intro, socialmedia, }) => {
|
|
9
19
|
const { prefix } = useGlobalSettings();
|
|
10
20
|
const baseClass = `${prefix}--hero-card`;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[
|
|
21
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
22
|
+
const backgroundClass = `${baseClass}__background__${background}`;
|
|
23
|
+
const cornercutClass = `${baseClass}__cornercut`;
|
|
24
|
+
const heroCardClasses = classNames(baseClass, themeClass, backgroundClass, {
|
|
25
|
+
[cornercutClass]: cornercut,
|
|
16
26
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
const eyebrowClass = `${baseClass}--eyebrow`;
|
|
28
|
+
const datecopyClass = `${baseClass}--datecopy`;
|
|
29
|
+
const introClass = `${baseClass}--intro`;
|
|
30
|
+
return (jsxs("div", Object.assign({ className: heroCardClasses }, { children: [eyebrow && jsx("p", Object.assign({ className: eyebrowClass }, { children: eyebrow })), jsx(HeroCardTitle, { baseclass: baseClass, title: title, url: url }), datecopy && jsx("p", Object.assign({ className: datecopyClass }, { children: datecopy })), intro && jsx("p", Object.assign({ className: introClass }, { children: intro })), socialmedia && jsx(SocialMedia, Object.assign({}, socialmedia, { theme: theme }))] })));
|
|
21
31
|
};
|
|
22
32
|
|
|
23
33
|
export { HeroCard as default };
|
|
@@ -6,5 +6,9 @@ import '../../hooks/useGlobalSettings.js';
|
|
|
6
6
|
import 'tslib';
|
|
7
7
|
import 'react';
|
|
8
8
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
9
|
-
import '../
|
|
10
|
-
import '../
|
|
9
|
+
import '../Breadcrumb/Breadcrumb.js';
|
|
10
|
+
import '../ContextMenu/ContextMenu.js';
|
|
11
|
+
import '../Tooltip/Tooltip.js';
|
|
12
|
+
import 'react-dom';
|
|
13
|
+
import '../SocialMedia/SocialMedia.js';
|
|
14
|
+
import '../SocialMedia/index.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { 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 LogoGridItem = ({ url, label, src }) => {
|
|
9
|
+
const { prefix } = useGlobalSettings();
|
|
10
|
+
const itemClass = `${prefix}--logo-grid--item`;
|
|
11
|
+
const itemLinkClass = `${prefix}--logo-grid--link`;
|
|
12
|
+
const gridItemClass = classNames(itemClass, {
|
|
13
|
+
[itemLinkClass]: !!url,
|
|
14
|
+
});
|
|
15
|
+
if (!url) {
|
|
16
|
+
return (jsx("div", Object.assign({ className: gridItemClass }, { children: jsx("img", { alt: label, src: src }) })));
|
|
17
|
+
}
|
|
18
|
+
return (jsx("a", Object.assign({ className: gridItemClass, href: url, target: "_blank", rel: "noopener noreferrer" }, { children: jsx("img", { alt: label, src: src }) })));
|
|
19
|
+
};
|
|
20
|
+
const LogoGrid = ({ logos, theme = "light" }) => {
|
|
21
|
+
const { prefix } = useGlobalSettings();
|
|
22
|
+
const baseClass = `${prefix}--logo-grid`;
|
|
23
|
+
const themeClass = `${baseClass}__theme__${theme}`;
|
|
24
|
+
const logoGridClass = classNames(baseClass, themeClass);
|
|
25
|
+
return (jsx("div", Object.assign({ className: logoGridClass }, { children: jsx("div", Object.assign({ className: `${baseClass}--logos` }, { children: logos.map((logo) => (jsx(LogoGridItem, Object.assign({}, logo)))) })) })));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { LogoGrid 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 };
|