@ilo-org/react 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/lib/cjs/components/Accordion/AccordionPanel.js +3 -3
- 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/index.js +2 -2
- package/lib/cjs/index.js +2 -2
- package/lib/esm/components/Accordion/AccordionPanel.js +3 -3
- 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/index.js +2 -2
- package/lib/esm/index.js +2 -2
- 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/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/types/index.d.ts +1 -3
- package/package.json +2 -2
- 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/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/types/index.ts +1 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @ilo-org/react
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ba46a3a7d]
|
|
8
|
+
- Updated dependencies [bdeca8720]
|
|
9
|
+
- Updated dependencies [bbd9262d1]
|
|
10
|
+
- Updated dependencies [ee14cd3d3]
|
|
11
|
+
- Updated dependencies [b56d55cfd]
|
|
12
|
+
- Updated dependencies [5022dfc4c]
|
|
13
|
+
- Updated dependencies [bacc0bba7]
|
|
14
|
+
- Updated dependencies [ba46a3a7d]
|
|
15
|
+
- Updated dependencies [652966ab7]
|
|
16
|
+
- @ilo-org/styles@0.7.0
|
|
17
|
+
|
|
18
|
+
## 0.7.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- c0648530f: Accordion items can now be made scrollable by passing `scroll: true` to the Accordion Panel component.
|
|
23
|
+
- 0dc9a8538: Add LogoGrid component which shows a list of logos with an optional link
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 77517f4dc: Refactor Hero and HeroCard to sync with new implemenation in Twig and Styles packages
|
|
28
|
+
- Updated dependencies [c0648530f]
|
|
29
|
+
- Updated dependencies [0dc9a8538]
|
|
30
|
+
- @ilo-org/styles@0.6.0
|
|
31
|
+
|
|
3
32
|
## 0.6.0
|
|
4
33
|
|
|
5
34
|
### Minor 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();
|
|
@@ -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;
|
|
@@ -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,12 +69,11 @@ 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');
|
|
74
76
|
require('@ilo-org/icons-react');
|
|
75
|
-
require('./SocialMedia/SocialMedia.js');
|
|
76
|
-
require('./SocialMedia/index.js');
|
|
77
77
|
require('./Logo/Logo.js');
|
|
78
78
|
require('./List/ListItem.js');
|
|
79
79
|
|
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,11 +70,10 @@ 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');
|
|
75
|
-
require('./components/SocialMedia/SocialMedia.js');
|
|
76
|
-
require('./components/SocialMedia/index.js');
|
|
77
77
|
require('./components/Logo/Logo.js');
|
|
78
78
|
require('./components/List/ListItem.js');
|
|
79
79
|
|
|
@@ -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,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 };
|
|
@@ -36,6 +36,7 @@ export { default as Checkbox } from './Checkbox/Checkbox.js';
|
|
|
36
36
|
export { default as DatePicker } from './DatePicker/DatePicker.js';
|
|
37
37
|
export { default as Form } from './Form/Form.js';
|
|
38
38
|
export { default as Hero } from './Hero/Hero.js';
|
|
39
|
+
import './SocialMedia/index.js';
|
|
39
40
|
export { default as LinkList } from './LinkList/LinkList.js';
|
|
40
41
|
export { default as Pagination } from './Pagination/Pagination.js';
|
|
41
42
|
export { default as SearchField } from './SearchField/SearchField.js';
|
|
@@ -66,11 +67,10 @@ import '../css-7414f50b.js';
|
|
|
66
67
|
import '../utils/transitionEndListener.js';
|
|
67
68
|
import '../utils/triggerBrowserReflow.js';
|
|
68
69
|
import './Hero/HeroCard.js';
|
|
70
|
+
import './SocialMedia/SocialMedia.js';
|
|
69
71
|
import '../VideoPlayer-a5fa87ce.js';
|
|
70
72
|
import '../utils/hoursMinutesSeconds.js';
|
|
71
73
|
import 'screenfull';
|
|
72
74
|
import '@ilo-org/icons-react';
|
|
73
|
-
import './SocialMedia/SocialMedia.js';
|
|
74
|
-
import './SocialMedia/index.js';
|
|
75
75
|
import './Logo/Logo.js';
|
|
76
76
|
import './List/ListItem.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export { default as Checkbox } from './components/Checkbox/Checkbox.js';
|
|
|
36
36
|
export { default as DatePicker } from './components/DatePicker/DatePicker.js';
|
|
37
37
|
export { default as Form } from './components/Form/Form.js';
|
|
38
38
|
export { default as Hero } from './components/Hero/Hero.js';
|
|
39
|
+
import './components/SocialMedia/index.js';
|
|
39
40
|
export { default as LinkList } from './components/LinkList/LinkList.js';
|
|
40
41
|
export { default as Pagination } from './components/Pagination/Pagination.js';
|
|
41
42
|
export { default as SearchField } from './components/SearchField/SearchField.js';
|
|
@@ -67,10 +68,9 @@ import './utils/transitionEndListener.js';
|
|
|
67
68
|
import './utils/triggerBrowserReflow.js';
|
|
68
69
|
import '@ilo-org/icons-react';
|
|
69
70
|
import './components/Hero/HeroCard.js';
|
|
71
|
+
import './components/SocialMedia/SocialMedia.js';
|
|
70
72
|
import './VideoPlayer-a5fa87ce.js';
|
|
71
73
|
import './utils/hoursMinutesSeconds.js';
|
|
72
74
|
import 'screenfull';
|
|
73
|
-
import './components/SocialMedia/SocialMedia.js';
|
|
74
|
-
import './components/SocialMedia/index.js';
|
|
75
75
|
import './components/Logo/Logo.js';
|
|
76
76
|
import './components/List/ListItem.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CardAlignment,
|
|
1
|
+
import { CardAlignment, ThemeTypes, CardCornerType, CardColor, CardSize, CardTypes } from "../../types";
|
|
2
2
|
import { LinkProps, LinkListProps } from "../LinkList/LinkList.props";
|
|
3
3
|
import { ProfileProps } from "../Profile/Profile.props";
|
|
4
4
|
export interface CardProps {
|
|
@@ -21,7 +21,7 @@ export interface CardProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* The theme type for the card. Theme doesn't apply to these card types: Multilink, Data, Stat and Detail. Possible themes: light | dark.
|
|
23
23
|
*/
|
|
24
|
-
theme?:
|
|
24
|
+
theme?: ThemeTypes;
|
|
25
25
|
/**
|
|
26
26
|
* Different variations of card: Graphic | Stat | Graphic Promo | Multilink | Feature | Detail | Fact List | Data.
|
|
27
27
|
*/
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeTypes } from "../../types";
|
|
2
|
+
import { BreadcrumbProps } from "../Breadcrumb/Breadcrumb.props";
|
|
2
3
|
import { ImageProps } from "../Image/Image.props";
|
|
4
|
+
import { TooltipProps } from "../Tooltip/Tooltip.props";
|
|
3
5
|
import { HeroCardProps } from "./HeroCard.props";
|
|
4
6
|
export interface HeroProps {
|
|
7
|
+
/**
|
|
8
|
+
* Vertical alignment of the hero card
|
|
9
|
+
*/
|
|
10
|
+
align?: "center" | "bottom" | "baseline";
|
|
11
|
+
/**
|
|
12
|
+
* Props to pass to the breadcrumb if there is one
|
|
13
|
+
*/
|
|
14
|
+
breadcrumb?: BreadcrumbProps;
|
|
15
|
+
/**
|
|
16
|
+
* Caption to render in the hero card
|
|
17
|
+
*/
|
|
18
|
+
caption?: TooltipProps;
|
|
19
|
+
/**
|
|
20
|
+
* Size the of hero card
|
|
21
|
+
*/
|
|
22
|
+
cardSize?: "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
5
23
|
/**
|
|
6
24
|
* Specify an optional className to be added to your Hero component.
|
|
7
25
|
*/
|
|
@@ -10,16 +28,20 @@ export interface HeroProps {
|
|
|
10
28
|
* Props for the image for the hero
|
|
11
29
|
*/
|
|
12
30
|
image?: ImageProps;
|
|
31
|
+
/**
|
|
32
|
+
* How to justify the hero card
|
|
33
|
+
*/
|
|
34
|
+
justify?: "start" | "center" | "offset";
|
|
13
35
|
/**
|
|
14
36
|
* Props for the card for the hero
|
|
15
37
|
*/
|
|
16
|
-
heroCard
|
|
38
|
+
heroCard: HeroCardProps;
|
|
17
39
|
/**
|
|
18
|
-
*
|
|
40
|
+
* The size of the poster image
|
|
19
41
|
*/
|
|
20
|
-
|
|
42
|
+
posterSize?: "small" | "medium" | "large" | "xlarge";
|
|
21
43
|
/**
|
|
22
|
-
*
|
|
44
|
+
* Theme for the card
|
|
23
45
|
*/
|
|
24
|
-
|
|
46
|
+
theme?: ThemeTypes;
|
|
25
47
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeTypes } from "../../types";
|
|
2
|
+
import { SocialMediaProps } from "../SocialMedia";
|
|
2
3
|
export interface HeroCardProps {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Specify whether the background should be solid, transparent or semi-transparent
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
background?: "solid" | "transparent" | "semi-transparent";
|
|
7
8
|
/**
|
|
8
9
|
* Specify an optional className to be added to your Hero component.
|
|
9
10
|
*/
|
|
10
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the card should have a cornercut or not
|
|
14
|
+
*/
|
|
15
|
+
cornercut?: boolean;
|
|
11
16
|
/**
|
|
12
17
|
* date copy for the hero card
|
|
13
18
|
*/
|
|
@@ -23,32 +28,17 @@ export interface HeroCardProps {
|
|
|
23
28
|
/**
|
|
24
29
|
* Specify the links to be displayed in this link group
|
|
25
30
|
*/
|
|
26
|
-
|
|
31
|
+
socialmedia?: SocialMediaProps;
|
|
27
32
|
/**
|
|
28
33
|
* Title for the page
|
|
29
34
|
*/
|
|
30
|
-
title
|
|
35
|
+
title: string;
|
|
31
36
|
/**
|
|
32
37
|
* Theme for the card
|
|
33
38
|
*/
|
|
34
|
-
theme?:
|
|
35
|
-
/**
|
|
36
|
-
* Type of hero for the card
|
|
37
|
-
*/
|
|
38
|
-
types?: HeroCardTypes;
|
|
39
|
-
}
|
|
40
|
-
interface SocialProps {
|
|
41
|
-
/**
|
|
42
|
-
* Specify the label for this link
|
|
43
|
-
*/
|
|
44
|
-
label?: Required<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Specify the url for this link
|
|
47
|
-
*/
|
|
48
|
-
url?: Required<string>;
|
|
39
|
+
theme?: ThemeTypes;
|
|
49
40
|
/**
|
|
50
|
-
*
|
|
41
|
+
* The link of the card's title if it has one
|
|
51
42
|
*/
|
|
52
|
-
|
|
43
|
+
url?: string;
|
|
53
44
|
}
|
|
54
|
-
export {};
|
|
@@ -2,11 +2,11 @@ interface ImageUrl {
|
|
|
2
2
|
/**
|
|
3
3
|
* Specify the breakpoint at which this image src should be used
|
|
4
4
|
*/
|
|
5
|
-
breakpoint
|
|
5
|
+
breakpoint: number;
|
|
6
6
|
/**
|
|
7
7
|
* Specify the url of this breakpoint's image src
|
|
8
8
|
*/
|
|
9
|
-
src
|
|
9
|
+
src: string;
|
|
10
10
|
}
|
|
11
11
|
export interface ImageProps {
|
|
12
12
|
/**
|
|
@@ -28,6 +28,10 @@ export interface ImageProps {
|
|
|
28
28
|
/**
|
|
29
29
|
* Specify the image src for the image
|
|
30
30
|
*/
|
|
31
|
-
url
|
|
31
|
+
url: ImageUrl[];
|
|
32
|
+
/**
|
|
33
|
+
* Value to pass to lading attribute
|
|
34
|
+
*/
|
|
35
|
+
loading?: "lazy" | "eager";
|
|
32
36
|
}
|
|
33
37
|
export {};
|