@ilo-org/react 0.12.0 → 0.13.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 +17 -0
- package/lib/cjs/components/Cards/CardGroup/CardGroup.js +42 -0
- package/lib/cjs/components/Cards/CardGroup/index.js +759 -0
- package/lib/cjs/components/Cards/DataCard/DataCard.js +27 -0
- package/lib/cjs/components/Cards/DataCard/index.js +73 -19
- package/lib/cjs/components/Cards/DetailCard/DetailCard.js +20 -0
- package/lib/cjs/components/Cards/DetailCard/index.js +17 -12
- package/lib/cjs/components/Cards/FactlistCard/FactListCard.js +23 -0
- package/lib/cjs/components/Cards/FactlistCard/index.js +16 -14
- package/lib/cjs/components/Cards/FeatureCard/FeatureCard.js +24 -0
- package/lib/cjs/components/Cards/FeatureCard/index.js +31 -16
- package/lib/cjs/components/Cards/MultilinkCard/MultiLinkCard.js +24 -0
- package/lib/cjs/components/Cards/MultilinkCard/index.js +35 -16
- package/lib/cjs/components/Cards/PromoCard/PromoCard.js +23 -0
- package/lib/cjs/components/Cards/PromoCard/index.js +18 -15
- package/lib/cjs/components/Cards/StatCard/StatCard.js +21 -0
- package/lib/cjs/components/Cards/StatCard/index.js +15 -13
- package/lib/cjs/components/Cards/TextCard/TextCard.js +23 -0
- package/lib/cjs/components/Cards/TextCard/index.js +22 -17
- package/lib/cjs/components/Footer/Footer.js +1 -1
- package/lib/cjs/components/Navigation/Navigation.js +3 -3
- package/lib/cjs/components/Pagination/Pagination.js +1 -1
- package/lib/cjs/components/index.js +10 -12
- package/lib/cjs/index.js +10 -12
- package/lib/esm/components/Cards/CardGroup/CardGroup.js +40 -0
- package/lib/esm/components/Cards/CardGroup/index.js +756 -0
- package/lib/esm/components/Cards/DataCard/DataCard.js +25 -0
- package/lib/esm/components/Cards/DataCard/index.js +72 -19
- package/lib/esm/components/Cards/DetailCard/DetailCard.js +18 -0
- package/lib/esm/components/Cards/DetailCard/index.js +16 -12
- package/lib/esm/components/Cards/FactlistCard/FactListCard.js +21 -0
- package/lib/esm/components/Cards/FactlistCard/index.js +15 -14
- package/lib/esm/components/Cards/FeatureCard/FeatureCard.js +22 -0
- package/lib/esm/components/Cards/FeatureCard/index.js +30 -16
- package/lib/esm/components/Cards/MultilinkCard/MultiLinkCard.js +22 -0
- package/lib/esm/components/Cards/MultilinkCard/index.js +34 -16
- package/lib/esm/components/Cards/PromoCard/PromoCard.js +21 -0
- package/lib/esm/components/Cards/PromoCard/index.js +17 -15
- package/lib/esm/components/Cards/StatCard/StatCard.js +19 -0
- package/lib/esm/components/Cards/StatCard/index.js +14 -13
- package/lib/esm/components/Cards/TextCard/TextCard.js +21 -0
- package/lib/esm/components/Cards/TextCard/index.js +21 -17
- package/lib/esm/components/Footer/Footer.js +1 -1
- package/lib/esm/components/Navigation/Navigation.js +3 -3
- package/lib/esm/components/Pagination/Pagination.js +1 -1
- package/lib/esm/components/index.js +9 -10
- package/lib/esm/index.js +9 -10
- package/lib/types/react/src/components/Cards/CardGroup/CardGroup.args.d.ts +13 -0
- package/lib/types/react/src/components/Cards/CardGroup/CardGroup.props.d.ts +58 -0
- package/lib/types/react/src/components/Cards/CardGroup/index.d.ts +3 -0
- package/lib/types/react/src/components/Cards/DataCard/DataCard.args.d.ts +2 -0
- package/lib/types/react/src/components/Cards/DataCard/DataCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/DataCard/DataCard.props.d.ts +50 -0
- package/lib/types/react/src/components/Cards/DataCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/DetailCard/DetailCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/DetailCard/DetailCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/DetailCard/DetailCard.props.d.ts +35 -0
- package/lib/types/react/src/components/Cards/DetailCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.props.d.ts +16 -0
- package/lib/types/react/src/components/Cards/FactlistCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.props.d.ts +31 -0
- package/lib/types/react/src/components/Cards/FeatureCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/MultilinkCard/MultiLinkCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/MultilinkCard/MultilinkCard.args.d.ts +2 -0
- package/lib/types/react/src/components/Cards/MultilinkCard/MultilinkCard.props.d.ts +25 -0
- package/lib/types/react/src/components/Cards/MultilinkCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/PromoCard/PromoCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/PromoCard/PromoCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/PromoCard/PromoCard.props.d.ts +30 -0
- package/lib/types/react/src/components/Cards/PromoCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/StatCard/StatCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/StatCard/StatCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/StatCard/StatCard.props.d.ts +18 -0
- package/lib/types/react/src/components/Cards/StatCard/index.d.ts +3 -4
- package/lib/types/react/src/components/Cards/TextCard/TextCard.args.d.ts +3 -0
- package/lib/types/react/src/components/Cards/TextCard/TextCard.d.ts +4 -0
- package/lib/types/react/src/components/Cards/TextCard/TextCard.props.d.ts +26 -0
- package/lib/types/react/src/components/Cards/TextCard/index.d.ts +3 -4
- package/lib/types/react/src/components/index.d.ts +1 -1
- package/lib/types/react/src/types/index.d.ts +4 -0
- package/package.json +2 -2
- package/src/components/Cards/{CardGroup.args.ts → CardGroup/CardGroup.args.ts} +196 -373
- package/src/components/Cards/CardGroup/CardGroup.props.ts +78 -0
- package/src/components/Cards/CardGroup/CardGroup.tsx +54 -0
- package/src/components/Cards/CardGroup/index.tsx +3 -0
- package/src/components/Cards/DataCard/DataCard.args.ts +69 -0
- package/src/components/Cards/DataCard/DataCard.props.ts +60 -0
- package/src/components/Cards/DataCard/DataCard.tsx +107 -0
- package/src/components/Cards/DataCard/index.tsx +3 -107
- package/src/components/Cards/DetailCard/DetailCard.args.ts +17 -0
- package/src/components/Cards/DetailCard/DetailCard.props.ts +43 -0
- package/src/components/Cards/DetailCard/DetailCard.tsx +62 -0
- package/src/components/Cards/DetailCard/index.tsx +3 -62
- package/src/components/Cards/FactlistCard/FactListCard.args.ts +14 -0
- package/src/components/Cards/FactlistCard/FactListCard.props.ts +19 -0
- package/src/components/Cards/FactlistCard/FactListCard.tsx +42 -0
- package/src/components/Cards/FactlistCard/index.tsx +3 -42
- package/src/components/Cards/FeatureCard/FeatureCard.args.ts +30 -0
- package/src/components/Cards/FeatureCard/FeatureCard.props.ts +38 -0
- package/src/components/Cards/FeatureCard/FeatureCard.tsx +69 -0
- package/src/components/Cards/FeatureCard/index.tsx +3 -69
- package/src/components/Cards/MultilinkCard/MultiLinkCard.tsx +76 -0
- package/src/components/Cards/MultilinkCard/MultilinkCard.args.ts +33 -0
- package/src/components/Cards/MultilinkCard/MultilinkCard.props.ts +30 -0
- package/src/components/Cards/MultilinkCard/index.tsx +3 -76
- package/src/components/Cards/PromoCard/PromoCard.args.ts +19 -0
- package/src/components/Cards/PromoCard/PromoCard.props.ts +36 -0
- package/src/components/Cards/PromoCard/PromoCard.tsx +60 -0
- package/src/components/Cards/PromoCard/index.tsx +3 -60
- package/src/components/Cards/StatCard/StatCard.args.ts +14 -0
- package/src/components/Cards/StatCard/StatCard.props.ts +21 -0
- package/src/components/Cards/StatCard/StatCard.tsx +36 -0
- package/src/components/Cards/StatCard/index.tsx +3 -36
- package/src/components/Cards/TextCard/TextCard.args.ts +21 -0
- package/src/components/Cards/TextCard/TextCard.props.ts +32 -0
- package/src/components/Cards/TextCard/TextCard.tsx +62 -0
- package/src/components/Cards/TextCard/index.tsx +3 -63
- package/src/components/Footer/Footer.args.ts +4 -16
- package/src/components/Footer/Footer.tsx +41 -37
- package/src/components/Navigation/Navigation.tsx +5 -5
- package/src/components/Pagination/Pagination.tsx +2 -1
- package/src/components/index.ts +1 -1
- package/src/types/index.ts +6 -0
- package/lib/cjs/components/Cards/Card.js +0 -40
- package/lib/cjs/components/Cards/CardGroup.js +0 -33
- package/lib/cjs/components/Cards/index.js +0 -37
- package/lib/esm/components/Cards/Card.js +0 -38
- package/lib/esm/components/Cards/CardGroup.js +0 -31
- package/lib/esm/components/Cards/index.js +0 -22
- package/lib/types/react/src/components/Cards/Card.d.ts +0 -4
- package/lib/types/react/src/components/Cards/Card.props.d.ts +0 -307
- package/lib/types/react/src/components/Cards/CardGroup.props.d.ts +0 -16
- package/lib/types/react/src/components/Cards/index.d.ts +0 -11
- package/public/fao-logo.svg +0 -195
- package/public/favicon.ico +0 -0
- package/public/hero.jpg +0 -0
- package/public/ilo-dg.jpg +0 -0
- package/public/ilo-headquarters.jpg +0 -0
- package/public/large.jpg +0 -0
- package/public/media-file-poster.jpg +0 -0
- package/public/medium.jpg +0 -0
- package/public/small.jpg +0 -0
- package/public/unhcr-logo.svg +0 -1
- package/public/unicef-logo.png +0 -0
- package/public/video-example.mp4 +0 -0
- package/public/wfp-logo.svg +0 -1
- package/public/who-logo.svg +0 -1
- package/public/youtube-video-poster.avif +0 -0
- package/src/components/Cards/Card.args.ts +0 -220
- package/src/components/Cards/Card.props.ts +0 -382
- package/src/components/Cards/Card.tsx +0 -36
- package/src/components/Cards/CardGroup.props.ts +0 -19
- package/src/components/Cards/CardGroup.tsx +0 -54
- package/src/components/Cards/index.ts +0 -22
- /package/lib/types/react/src/components/Cards/{CardGroup.d.ts → CardGroup/CardGroup.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ThemeTypes, CardSize } from "../../../types";
|
|
2
|
+
|
|
3
|
+
export type FactlistCardProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The title of the card
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Will render the card to appear on light or dark backgrounds
|
|
11
|
+
*/
|
|
12
|
+
theme?: ThemeTypes;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* How big should the card be
|
|
16
|
+
*/
|
|
17
|
+
size?: Omit<CardSize, "standard">;
|
|
18
|
+
list?: string[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { FactlistCardProps } from "./FactListCard.props";
|
|
5
|
+
import { List, ListItem } from "../../List";
|
|
6
|
+
|
|
7
|
+
const FactlistCard: FC<FactlistCardProps> = ({
|
|
8
|
+
title,
|
|
9
|
+
theme = "narrow",
|
|
10
|
+
size,
|
|
11
|
+
list,
|
|
12
|
+
}) => {
|
|
13
|
+
const { prefix } = useGlobalSettings();
|
|
14
|
+
|
|
15
|
+
const baseClass = `${prefix}--card`;
|
|
16
|
+
|
|
17
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__factlist`, {
|
|
18
|
+
[`${baseClass}__size__${size}`]: size,
|
|
19
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className={cardClasses}>
|
|
24
|
+
<div className={`${baseClass}--wrap`}>
|
|
25
|
+
<div className={`${baseClass}--content`}>
|
|
26
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
27
|
+
{list && (
|
|
28
|
+
<List alignment="default" ordered="unordered">
|
|
29
|
+
{list.map((item, index) => (
|
|
30
|
+
<ListItem id={`list${index}`}>
|
|
31
|
+
<p>{item}</p>
|
|
32
|
+
</ListItem>
|
|
33
|
+
))}
|
|
34
|
+
</List>
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default FactlistCard;
|
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { FactlistCardProps } from "../Card.props";
|
|
5
|
-
import { List, ListItem } from "../../List";
|
|
6
|
-
|
|
7
|
-
const FactlistCard: FC<FactlistCardProps> = ({
|
|
8
|
-
title,
|
|
9
|
-
theme = "narrow",
|
|
10
|
-
size,
|
|
11
|
-
list,
|
|
12
|
-
}) => {
|
|
13
|
-
const { prefix } = useGlobalSettings();
|
|
14
|
-
|
|
15
|
-
const baseClass = `${prefix}--card`;
|
|
16
|
-
|
|
17
|
-
const cardClasses = classnames(baseClass, `${baseClass}__type__factlist`, {
|
|
18
|
-
[`${baseClass}__size__${size}`]: size,
|
|
19
|
-
[`${baseClass}__theme__${theme}`]: theme,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className={cardClasses}>
|
|
24
|
-
<div className={`${baseClass}--wrap`}>
|
|
25
|
-
<div className={`${baseClass}--content`}>
|
|
26
|
-
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
27
|
-
{list && (
|
|
28
|
-
<List alignment="default" ordered="unordered">
|
|
29
|
-
{list.map((item, index) => (
|
|
30
|
-
<ListItem id={`list${index}`}>
|
|
31
|
-
<p>{item}</p>
|
|
32
|
-
</ListItem>
|
|
33
|
-
))}
|
|
34
|
-
</List>
|
|
35
|
-
)}
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default FactlistCard;
|
|
1
|
+
export { default as FactlistCard } from "./FactListCard";
|
|
2
|
+
export type { FactlistCardProps } from "./FactListCard.props";
|
|
3
|
+
export { FactlistCardArgs } from "./FactListCard.args";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FeatureCardProps } from ".";
|
|
2
|
+
|
|
3
|
+
export const FeatureCardArgs: FeatureCardProps = {
|
|
4
|
+
isvideo: false,
|
|
5
|
+
title:
|
|
6
|
+
"ILO welcomes G7 call to make a just transition to a green economy happen",
|
|
7
|
+
eyebrow: "High-level meeting",
|
|
8
|
+
theme: "light",
|
|
9
|
+
date: {
|
|
10
|
+
human: "18 March 2023",
|
|
11
|
+
unix: "1670389200",
|
|
12
|
+
},
|
|
13
|
+
image: "/hero.jpg",
|
|
14
|
+
link: "https:/www.ilo.org",
|
|
15
|
+
linklist: {
|
|
16
|
+
headline: "",
|
|
17
|
+
linkgroup: [
|
|
18
|
+
{
|
|
19
|
+
links: [
|
|
20
|
+
{
|
|
21
|
+
label: "Read the press release",
|
|
22
|
+
url: "http://www.google.com",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default FeatureCardArgs;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ThemeTypes, CardSize, EventDate } from "../../../types";
|
|
2
|
+
|
|
3
|
+
import { LinkListProps } from "../../LinkList/LinkList.props";
|
|
4
|
+
export type FeatureCardProps = {
|
|
5
|
+
isvideo?: boolean;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A line of text that appears as a small heading above the title of the card
|
|
9
|
+
*/
|
|
10
|
+
eyebrow?: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The title of the card
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Will render the card to appear on light or dark backgrounds
|
|
19
|
+
*/
|
|
20
|
+
theme?: ThemeTypes;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* How big should the card be
|
|
24
|
+
*/
|
|
25
|
+
size?: Omit<CardSize, "standard">;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Specify the event Date, in both human and Unix format.
|
|
29
|
+
*/
|
|
30
|
+
date?: EventDate;
|
|
31
|
+
link?: string;
|
|
32
|
+
linklist?: LinkListProps;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The image to show in the card
|
|
36
|
+
*/
|
|
37
|
+
image?: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { FeatureCardProps } from "./FeatureCard.props";
|
|
5
|
+
import { LinkList } from "../../LinkList";
|
|
6
|
+
|
|
7
|
+
const FeatureCard: FC<FeatureCardProps> = ({
|
|
8
|
+
isvideo,
|
|
9
|
+
eyebrow,
|
|
10
|
+
title,
|
|
11
|
+
theme,
|
|
12
|
+
size = "narrow",
|
|
13
|
+
date,
|
|
14
|
+
link,
|
|
15
|
+
linklist,
|
|
16
|
+
image,
|
|
17
|
+
}) => {
|
|
18
|
+
const { prefix } = useGlobalSettings();
|
|
19
|
+
|
|
20
|
+
const baseClass = `${prefix}--card`;
|
|
21
|
+
|
|
22
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__feature`, {
|
|
23
|
+
[`${baseClass}__action`]: link,
|
|
24
|
+
[`${baseClass}__size__${size}`]: size,
|
|
25
|
+
[`${baseClass}__isvideo`]: isvideo,
|
|
26
|
+
[`${baseClass}__linklist`]: linklist,
|
|
27
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={cardClasses}>
|
|
32
|
+
{link && (
|
|
33
|
+
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
34
|
+
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
35
|
+
</a>
|
|
36
|
+
)}
|
|
37
|
+
<div className={`${baseClass}--wrap`}>
|
|
38
|
+
{image && (
|
|
39
|
+
<div className={`${baseClass}--image--wrapper`}>
|
|
40
|
+
<picture>
|
|
41
|
+
<img
|
|
42
|
+
className={`${baseClass}--picture`}
|
|
43
|
+
src={image}
|
|
44
|
+
alt={title}
|
|
45
|
+
/>
|
|
46
|
+
</picture>
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
<div className={`${baseClass}--content`}>
|
|
50
|
+
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
51
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
52
|
+
{date && (
|
|
53
|
+
<time className={`${baseClass}--date`} dateTime={date.unix}>
|
|
54
|
+
{date.human}
|
|
55
|
+
</time>
|
|
56
|
+
)}
|
|
57
|
+
{linklist && (
|
|
58
|
+
<LinkList
|
|
59
|
+
headline={linklist.headline}
|
|
60
|
+
linkgroup={linklist.linkgroup}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default FeatureCard;
|
|
@@ -1,69 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { FeatureCardProps } from "../Card.props";
|
|
5
|
-
import { LinkList } from "../../LinkList";
|
|
6
|
-
|
|
7
|
-
const FeatureCard: FC<FeatureCardProps> = ({
|
|
8
|
-
isvideo,
|
|
9
|
-
eyebrow,
|
|
10
|
-
title,
|
|
11
|
-
theme,
|
|
12
|
-
size = "narrow",
|
|
13
|
-
date,
|
|
14
|
-
link,
|
|
15
|
-
linklist,
|
|
16
|
-
image,
|
|
17
|
-
}) => {
|
|
18
|
-
const { prefix } = useGlobalSettings();
|
|
19
|
-
|
|
20
|
-
const baseClass = `${prefix}--card`;
|
|
21
|
-
|
|
22
|
-
const cardClasses = classnames(baseClass, `${baseClass}__type__feature`, {
|
|
23
|
-
[`${baseClass}__action`]: link,
|
|
24
|
-
[`${baseClass}__size__${size}`]: size,
|
|
25
|
-
[`${baseClass}__isvideo`]: isvideo,
|
|
26
|
-
[`${baseClass}__linklist`]: linklist,
|
|
27
|
-
[`${baseClass}__theme__${theme}`]: theme,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className={cardClasses}>
|
|
32
|
-
{link && (
|
|
33
|
-
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
34
|
-
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
35
|
-
</a>
|
|
36
|
-
)}
|
|
37
|
-
<div className={`${baseClass}--wrap`}>
|
|
38
|
-
{image && (
|
|
39
|
-
<div className={`${baseClass}--image--wrapper`}>
|
|
40
|
-
<picture>
|
|
41
|
-
<img
|
|
42
|
-
className={`${baseClass}--picture`}
|
|
43
|
-
src={image}
|
|
44
|
-
alt={title}
|
|
45
|
-
/>
|
|
46
|
-
</picture>
|
|
47
|
-
</div>
|
|
48
|
-
)}
|
|
49
|
-
<div className={`${baseClass}--content`}>
|
|
50
|
-
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
51
|
-
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
52
|
-
{date && (
|
|
53
|
-
<time className={`${baseClass}--date`} dateTime={date.unix}>
|
|
54
|
-
{date.human}
|
|
55
|
-
</time>
|
|
56
|
-
)}
|
|
57
|
-
{linklist && (
|
|
58
|
-
<LinkList
|
|
59
|
-
headline={linklist.headline}
|
|
60
|
-
linkgroup={linklist.linkgroup}
|
|
61
|
-
/>
|
|
62
|
-
)}
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default FeatureCard;
|
|
1
|
+
export { default as FeatureCard } from "./FeatureCard";
|
|
2
|
+
export type { FeatureCardProps } from "./FeatureCard.props";
|
|
3
|
+
export { FeatureCardArgs } from "./FeatureCard.args";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { MultilinkCardProps } from "./MultilinkCard.props";
|
|
5
|
+
import { LinkList } from "../../LinkList";
|
|
6
|
+
|
|
7
|
+
const MultilinkCard: FC<MultilinkCardProps> = ({
|
|
8
|
+
isvideo,
|
|
9
|
+
eyebrow,
|
|
10
|
+
title,
|
|
11
|
+
size = "narrow",
|
|
12
|
+
alignment,
|
|
13
|
+
intro,
|
|
14
|
+
link,
|
|
15
|
+
linklist,
|
|
16
|
+
image,
|
|
17
|
+
}) => {
|
|
18
|
+
const { prefix } = useGlobalSettings();
|
|
19
|
+
|
|
20
|
+
const baseClass = `${prefix}--card`;
|
|
21
|
+
|
|
22
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__multilink`, {
|
|
23
|
+
[`${baseClass}__align__${alignment}`]: alignment,
|
|
24
|
+
[`${baseClass}__action`]: link,
|
|
25
|
+
[`${baseClass}__size__${size}`]: size,
|
|
26
|
+
[`${baseClass}__isvideo`]: isvideo,
|
|
27
|
+
[`${baseClass}__linklist`]: linklist,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={cardClasses}>
|
|
32
|
+
{link && (
|
|
33
|
+
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
34
|
+
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
35
|
+
</a>
|
|
36
|
+
)}
|
|
37
|
+
<div className={`${baseClass}--wrap`}>
|
|
38
|
+
{image && (
|
|
39
|
+
<div className={`${baseClass}--image--wrapper`}>
|
|
40
|
+
<picture>
|
|
41
|
+
<img
|
|
42
|
+
className={`${baseClass}--picture`}
|
|
43
|
+
src={image}
|
|
44
|
+
alt={title}
|
|
45
|
+
/>
|
|
46
|
+
</picture>
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
<div className={`${baseClass}--content`}>
|
|
50
|
+
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
51
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
52
|
+
{image && (
|
|
53
|
+
<div className={`${baseClass}--image--wrapper`}>
|
|
54
|
+
<picture>
|
|
55
|
+
<img
|
|
56
|
+
className={`${baseClass}--picture`}
|
|
57
|
+
src={image}
|
|
58
|
+
alt={title}
|
|
59
|
+
/>
|
|
60
|
+
</picture>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
{intro && <p className={`${baseClass}--intro`}>{intro}</p>}
|
|
64
|
+
{linklist && (
|
|
65
|
+
<LinkList
|
|
66
|
+
headline={linklist.headline}
|
|
67
|
+
linkgroup={linklist.linkgroup}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default MultilinkCard;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MultilinkCardProps } from ".";
|
|
2
|
+
|
|
3
|
+
export const MultilinkCardArgs: MultilinkCardProps = {
|
|
4
|
+
title:
|
|
5
|
+
"ILO welcomes G7 call to make a just transition to a green economy happen",
|
|
6
|
+
eyebrow: "High-level meeting",
|
|
7
|
+
intro:
|
|
8
|
+
"At the end of their meeting the G7 Labour Ministers highlighted the urgent need to greater focus on rights and occupational safety and health.",
|
|
9
|
+
image: "/hero.jpg",
|
|
10
|
+
alignment: "left",
|
|
11
|
+
link: "https:/www.ilo.org",
|
|
12
|
+
linklist: {
|
|
13
|
+
headline: "",
|
|
14
|
+
linkgroup: [
|
|
15
|
+
{
|
|
16
|
+
links: [
|
|
17
|
+
{
|
|
18
|
+
label: "Read the press release",
|
|
19
|
+
url: "https://www.ilo.org",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "See the statement",
|
|
23
|
+
url: "https://www.ilo.org",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "Remarks to G7 Openening Session",
|
|
27
|
+
url: "https://www.ilo.org",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CardAlignment, CardSize } from "../../../types";
|
|
2
|
+
import { LinkListProps } from "../../LinkList/LinkList.props";
|
|
3
|
+
|
|
4
|
+
export type MultilinkCardProps = {
|
|
5
|
+
isvideo?: boolean;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A line of text that appears as a small heading above the title of the card
|
|
9
|
+
*/
|
|
10
|
+
eyebrow?: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The title of the card
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* How big should the card be
|
|
19
|
+
*/
|
|
20
|
+
size?: CardSize;
|
|
21
|
+
alignment?: CardAlignment;
|
|
22
|
+
intro?: string;
|
|
23
|
+
link?: string;
|
|
24
|
+
linklist?: LinkListProps;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The image to show in the card
|
|
28
|
+
*/
|
|
29
|
+
image?: string;
|
|
30
|
+
};
|
|
@@ -1,76 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { MultilinkCardProps } from "../Card.props";
|
|
5
|
-
import { LinkList } from "../../LinkList";
|
|
6
|
-
|
|
7
|
-
const MultilinkCard: FC<MultilinkCardProps> = ({
|
|
8
|
-
isvideo,
|
|
9
|
-
eyebrow,
|
|
10
|
-
title,
|
|
11
|
-
size = "narrow",
|
|
12
|
-
alignment,
|
|
13
|
-
intro,
|
|
14
|
-
link,
|
|
15
|
-
linklist,
|
|
16
|
-
image,
|
|
17
|
-
}) => {
|
|
18
|
-
const { prefix } = useGlobalSettings();
|
|
19
|
-
|
|
20
|
-
const baseClass = `${prefix}--card`;
|
|
21
|
-
|
|
22
|
-
const cardClasses = classnames(baseClass, `${baseClass}__type__multilink`, {
|
|
23
|
-
[`${baseClass}__align__${alignment}`]: alignment,
|
|
24
|
-
[`${baseClass}__action`]: link,
|
|
25
|
-
[`${baseClass}__size__${size}`]: size,
|
|
26
|
-
[`${baseClass}__isvideo`]: isvideo,
|
|
27
|
-
[`${baseClass}__linklist`]: linklist,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className={cardClasses}>
|
|
32
|
-
{link && (
|
|
33
|
-
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
34
|
-
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
35
|
-
</a>
|
|
36
|
-
)}
|
|
37
|
-
<div className={`${baseClass}--wrap`}>
|
|
38
|
-
{image && (
|
|
39
|
-
<div className={`${baseClass}--image--wrapper`}>
|
|
40
|
-
<picture>
|
|
41
|
-
<img
|
|
42
|
-
className={`${baseClass}--picture`}
|
|
43
|
-
src={image}
|
|
44
|
-
alt={title}
|
|
45
|
-
/>
|
|
46
|
-
</picture>
|
|
47
|
-
</div>
|
|
48
|
-
)}
|
|
49
|
-
<div className={`${baseClass}--content`}>
|
|
50
|
-
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
51
|
-
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
52
|
-
{image && (
|
|
53
|
-
<div className={`${baseClass}--image--wrapper`}>
|
|
54
|
-
<picture>
|
|
55
|
-
<img
|
|
56
|
-
className={`${baseClass}--picture`}
|
|
57
|
-
src={image}
|
|
58
|
-
alt={title}
|
|
59
|
-
/>
|
|
60
|
-
</picture>
|
|
61
|
-
</div>
|
|
62
|
-
)}
|
|
63
|
-
{intro && <p className={`${baseClass}--intro`}>{intro}</p>}
|
|
64
|
-
{linklist && (
|
|
65
|
-
<LinkList
|
|
66
|
-
headline={linklist.headline}
|
|
67
|
-
linkgroup={linklist.linkgroup}
|
|
68
|
-
/>
|
|
69
|
-
)}
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export default MultilinkCard;
|
|
1
|
+
export { default as MultilinkCard } from "./MultiLinkCard";
|
|
2
|
+
export type { MultilinkCardProps } from "./MultilinkCard.props";
|
|
3
|
+
export { MultilinkCardArgs } from "./MultilinkCard.args";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PromoCardProps } from ".";
|
|
2
|
+
|
|
3
|
+
export const PromoCardArgs: PromoCardProps = {
|
|
4
|
+
size: "standard",
|
|
5
|
+
title:
|
|
6
|
+
"ILO welcomes G7 call to make a just transition to a green economy happen",
|
|
7
|
+
eyebrow: "High-level meeting",
|
|
8
|
+
theme: "dark",
|
|
9
|
+
cornercut: true,
|
|
10
|
+
intro:
|
|
11
|
+
"At the end of their meeting the G7 Labour Ministers highlighted the urgent need to greater focus on rights and occupational safety and health.",
|
|
12
|
+
link: "https:/www.ilo.org",
|
|
13
|
+
cta: {
|
|
14
|
+
label: "Read the press release",
|
|
15
|
+
url: "https://www.ilo.org",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default PromoCardArgs;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ThemeTypes, CardCornerType, CardSize } from "../../../types";
|
|
2
|
+
import { LinkProps } from "../../LinkList/LinkList.props";
|
|
3
|
+
|
|
4
|
+
export type PromoCardProps = {
|
|
5
|
+
/**
|
|
6
|
+
* A line of text that appears as a small heading above the title of the card
|
|
7
|
+
*/
|
|
8
|
+
eyebrow?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The title of the card
|
|
12
|
+
*/
|
|
13
|
+
title: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Will render the card to appear on light or dark backgrounds
|
|
17
|
+
*/
|
|
18
|
+
theme?: ThemeTypes;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* How big should the card be
|
|
22
|
+
*/
|
|
23
|
+
size?: CardSize;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Apply an optional corner cut to the top of the card
|
|
27
|
+
*/
|
|
28
|
+
cornercut?: CardCornerType;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Introductory text in the card
|
|
32
|
+
*/
|
|
33
|
+
intro?: string;
|
|
34
|
+
link?: string;
|
|
35
|
+
cta?: LinkProps;
|
|
36
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { PromoCardProps } from "./PromoCard.props";
|
|
5
|
+
|
|
6
|
+
const PromoCard: FC<PromoCardProps> = ({
|
|
7
|
+
eyebrow,
|
|
8
|
+
title,
|
|
9
|
+
theme,
|
|
10
|
+
size = "narrow",
|
|
11
|
+
cornercut,
|
|
12
|
+
intro,
|
|
13
|
+
link,
|
|
14
|
+
cta,
|
|
15
|
+
}) => {
|
|
16
|
+
const { prefix } = useGlobalSettings();
|
|
17
|
+
|
|
18
|
+
const baseClass = `${prefix}--card`;
|
|
19
|
+
|
|
20
|
+
const wrapperClass = classnames(
|
|
21
|
+
`${baseClass}--wrapper`,
|
|
22
|
+
`${baseClass}--wrapper__type__promo ${baseClass}--wrapper__type__promo__size__${size}`
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__promo`, {
|
|
26
|
+
[`${baseClass}__cornercut`]: cornercut,
|
|
27
|
+
[`${baseClass}__action`]: link,
|
|
28
|
+
[`${baseClass}__size__${size}`]: size,
|
|
29
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={wrapperClass}>
|
|
34
|
+
<div className={cardClasses}>
|
|
35
|
+
{link && (
|
|
36
|
+
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
37
|
+
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
38
|
+
</a>
|
|
39
|
+
)}
|
|
40
|
+
<div className={`${baseClass}--wrap`}>
|
|
41
|
+
<div className={`${baseClass}--content`}>
|
|
42
|
+
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
43
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
44
|
+
{intro && <p className={`${baseClass}--intro`}>{intro}</p>}
|
|
45
|
+
{cta && cta.label && (
|
|
46
|
+
<a
|
|
47
|
+
className={`${baseClass}--cta ${prefix}--button ${prefix}--button--medium ${prefix}--button--primary`}
|
|
48
|
+
href={cta.url}
|
|
49
|
+
>
|
|
50
|
+
<span className="link__label">{cta.label}</span>
|
|
51
|
+
</a>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default PromoCard;
|