@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
|
@@ -1,60 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { PromoCardProps } from "../Card.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;
|
|
1
|
+
export { default as PromoCard } from "./PromoCard";
|
|
2
|
+
export type { PromoCardProps } from "./PromoCard.props";
|
|
3
|
+
export { PromoCardArgs } from "./PromoCard.args";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StatCardProps } from ".";
|
|
2
|
+
|
|
3
|
+
export const StatCardArgs: StatCardProps = {
|
|
4
|
+
title: "Global employment growth down by half in 2023",
|
|
5
|
+
intro:
|
|
6
|
+
"The current global economic slowdown is likely to force more workers to accept lower quality, poorly paid jobs which lack job security and social protection, so accentuating inequalities exacerbated by the COVID-19 crisis.",
|
|
7
|
+
color: "turquoise",
|
|
8
|
+
source: {
|
|
9
|
+
label: "World Employment and Social Outlook: Trends 2023",
|
|
10
|
+
url: "https://www.ilo.org",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default StatCardArgs;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CardColor, CardSize } from "../../../types";
|
|
2
|
+
import { LinkProps } from "../../LinkList/LinkList.props";
|
|
3
|
+
|
|
4
|
+
export type StatCardProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The title of the card
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
color?: CardColor;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How big should the card be
|
|
13
|
+
*/
|
|
14
|
+
size?: Omit<CardSize, "narrow" | "wide">;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Introductory text in the card
|
|
18
|
+
*/
|
|
19
|
+
intro?: string;
|
|
20
|
+
source?: LinkProps;
|
|
21
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { StatCardProps } from "./StatCard.props";
|
|
5
|
+
import { Link } from "../../Link";
|
|
6
|
+
|
|
7
|
+
const StatCard: FC<StatCardProps> = ({
|
|
8
|
+
title,
|
|
9
|
+
color,
|
|
10
|
+
size = "standard",
|
|
11
|
+
intro,
|
|
12
|
+
source,
|
|
13
|
+
}) => {
|
|
14
|
+
const { prefix } = useGlobalSettings();
|
|
15
|
+
|
|
16
|
+
const baseClass = `${prefix}--card`;
|
|
17
|
+
|
|
18
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__stat`, {
|
|
19
|
+
[`${baseClass}__color__${color}`]: color,
|
|
20
|
+
[`${baseClass}__size__${size}`]: size,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={cardClasses}>
|
|
25
|
+
<div className={`${baseClass}--wrap`}>
|
|
26
|
+
<div className={`${baseClass}--content`}>
|
|
27
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
28
|
+
{intro && <p className={`${baseClass}--intro`}>{intro}</p>}
|
|
29
|
+
{source && <Link url={source.url}>{source.label}</Link>}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default StatCard;
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { StatCardProps } from "../Card.props";
|
|
5
|
-
import { Link } from "../../Link";
|
|
6
|
-
|
|
7
|
-
const StatCard: FC<StatCardProps> = ({
|
|
8
|
-
title,
|
|
9
|
-
color,
|
|
10
|
-
size = "standard",
|
|
11
|
-
intro,
|
|
12
|
-
source,
|
|
13
|
-
}) => {
|
|
14
|
-
const { prefix } = useGlobalSettings();
|
|
15
|
-
|
|
16
|
-
const baseClass = `${prefix}--card`;
|
|
17
|
-
|
|
18
|
-
const cardClasses = classnames(baseClass, `${baseClass}__type__stat`, {
|
|
19
|
-
[`${baseClass}__color__${color}`]: color,
|
|
20
|
-
[`${baseClass}__size__${size}`]: size,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={cardClasses}>
|
|
25
|
-
<div className={`${baseClass}--wrap`}>
|
|
26
|
-
<div className={`${baseClass}--content`}>
|
|
27
|
-
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
28
|
-
{intro && <p className={`${baseClass}--intro`}>{intro}</p>}
|
|
29
|
-
{source && <Link url={source.url}>{source.label}</Link>}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default StatCard;
|
|
1
|
+
export { default as StatCard } from "./StatCard";
|
|
2
|
+
export type { StatCardProps } from "./StatCard.props";
|
|
3
|
+
export { StatCardArgs } from "./StatCard.args";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TextCardProps } from ".";
|
|
2
|
+
|
|
3
|
+
export const TextCardArgs: TextCardProps = {
|
|
4
|
+
title: "Why we need greater social justice",
|
|
5
|
+
eyebrow: "Podcast",
|
|
6
|
+
date: {
|
|
7
|
+
human: "20 September 2022",
|
|
8
|
+
unix: "1670389200",
|
|
9
|
+
},
|
|
10
|
+
theme: "light",
|
|
11
|
+
link: "https:/www.ilo.org",
|
|
12
|
+
profile: {
|
|
13
|
+
avatar: "/ilo-dg.jpg",
|
|
14
|
+
description:
|
|
15
|
+
"Gilbert Houngbo is the Director-General of the International Labour Organization",
|
|
16
|
+
name: "Gilbert Houngbo",
|
|
17
|
+
role: "ILO Director-General",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default TextCardArgs;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ThemeTypes, CardSize, EventDate } from "../../../types";
|
|
2
|
+
|
|
3
|
+
import { ProfileProps } from "../../Profile/Profile.props";
|
|
4
|
+
|
|
5
|
+
export type TextCardProps = {
|
|
6
|
+
/**
|
|
7
|
+
* A line of text that appears as a small heading above the title of the card
|
|
8
|
+
*/
|
|
9
|
+
eyebrow?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The title of the card
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Will render the card to appear on light or dark backgrounds
|
|
18
|
+
*/
|
|
19
|
+
theme?: ThemeTypes;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* How big should the card be
|
|
23
|
+
*/
|
|
24
|
+
size?: Omit<CardSize, "standard">;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Specify the event Date, in both human and Unix format.
|
|
28
|
+
*/
|
|
29
|
+
date?: EventDate;
|
|
30
|
+
profile: ProfileProps;
|
|
31
|
+
link?: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../../hooks/useGlobalSettings";
|
|
4
|
+
import { TextCardProps } from "./TextCard.props";
|
|
5
|
+
import { Profile } from "../../Profile";
|
|
6
|
+
|
|
7
|
+
const TextCard: FC<TextCardProps> = ({
|
|
8
|
+
eyebrow,
|
|
9
|
+
title,
|
|
10
|
+
theme,
|
|
11
|
+
size,
|
|
12
|
+
date,
|
|
13
|
+
profile,
|
|
14
|
+
link,
|
|
15
|
+
}) => {
|
|
16
|
+
const { prefix } = useGlobalSettings();
|
|
17
|
+
|
|
18
|
+
const baseClass = `${prefix}--card`;
|
|
19
|
+
|
|
20
|
+
const wrapperClass = classnames(`${baseClass}--wrapper`);
|
|
21
|
+
|
|
22
|
+
const cardClasses = classnames(baseClass, `${baseClass}__type__text`, {
|
|
23
|
+
[`${baseClass}__action`]: link,
|
|
24
|
+
[`${baseClass}__size__${size}`]: size,
|
|
25
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={wrapperClass}>
|
|
30
|
+
<div className={cardClasses}>
|
|
31
|
+
{link && (
|
|
32
|
+
<a className={`${baseClass}--link`} href={link} title={title}>
|
|
33
|
+
<span className={`${baseClass}--link--text`}>{title}</span>
|
|
34
|
+
</a>
|
|
35
|
+
)}
|
|
36
|
+
<div className={`${baseClass}--wrap`}>
|
|
37
|
+
<div className={`${baseClass}--content`}>
|
|
38
|
+
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
39
|
+
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
40
|
+
{date && (
|
|
41
|
+
<time className={`${baseClass}--date`} dateTime={date.unix}>
|
|
42
|
+
{date.human}
|
|
43
|
+
</time>
|
|
44
|
+
)}
|
|
45
|
+
{profile && profile.avatar && (
|
|
46
|
+
<Profile
|
|
47
|
+
avatar={profile.avatar}
|
|
48
|
+
description={profile.description}
|
|
49
|
+
link={profile.link}
|
|
50
|
+
name={profile.name}
|
|
51
|
+
role={profile.role}
|
|
52
|
+
className={`${prefix}--profile--contents--${theme}`}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default TextCard;
|
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { TextCardProps } from "../Card.props";
|
|
5
|
-
import { Profile } from "../../Profile";
|
|
6
|
-
|
|
7
|
-
const TextCard: FC<TextCardProps> = ({
|
|
8
|
-
eyebrow,
|
|
9
|
-
title,
|
|
10
|
-
theme,
|
|
11
|
-
size,
|
|
12
|
-
date,
|
|
13
|
-
profile,
|
|
14
|
-
link,
|
|
15
|
-
}) => {
|
|
16
|
-
const { prefix } = useGlobalSettings();
|
|
17
|
-
|
|
18
|
-
const baseClass = `${prefix}--card`;
|
|
19
|
-
|
|
20
|
-
const wrapperClass = classnames(`${baseClass}--wrapper`);
|
|
21
|
-
|
|
22
|
-
const cardClasses = classnames(baseClass, `${baseClass}__type__text`, {
|
|
23
|
-
[`${baseClass}__action`]: link,
|
|
24
|
-
[`${baseClass}__size__${size}`]: size,
|
|
25
|
-
[`${baseClass}__theme__${theme}`]: theme,
|
|
26
|
-
});
|
|
27
|
-
console.log("heloo");
|
|
28
|
-
console.log(profile);
|
|
29
|
-
return (
|
|
30
|
-
<div className={wrapperClass}>
|
|
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
|
-
<div className={`${baseClass}--content`}>
|
|
39
|
-
{eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
|
|
40
|
-
{title && <h5 className={`${baseClass}--title`}>{title}</h5>}
|
|
41
|
-
{date && (
|
|
42
|
-
<time className={`${baseClass}--date`} dateTime={date.unix}>
|
|
43
|
-
{date.human}
|
|
44
|
-
</time>
|
|
45
|
-
)}
|
|
46
|
-
{profile && profile.avatar && (
|
|
47
|
-
<Profile
|
|
48
|
-
avatar={profile.avatar}
|
|
49
|
-
description={profile.description}
|
|
50
|
-
link={profile.link}
|
|
51
|
-
name={profile.name}
|
|
52
|
-
role={profile.role}
|
|
53
|
-
className={`${prefix}--profile--contents--${theme}`}
|
|
54
|
-
/>
|
|
55
|
-
)}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export default TextCard;
|
|
1
|
+
export { default as TextCard } from "./TextCard";
|
|
2
|
+
export type { TextCardProps } from "./TextCard.props";
|
|
3
|
+
export { TextCardArgs } from "./TextCard.args";
|
|
@@ -17,27 +17,15 @@ const basic: FooterProps = {
|
|
|
17
17
|
{
|
|
18
18
|
links: [
|
|
19
19
|
{
|
|
20
|
-
label: "
|
|
20
|
+
label: "Contact us",
|
|
21
21
|
url: "https://www.ilo.org",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
label: "
|
|
24
|
+
label: "Contact us",
|
|
25
25
|
url: "https://www.ilo.org",
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
label: "
|
|
29
|
-
url: "https://www.ilo.org",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: "Link Four",
|
|
33
|
-
url: "https://www.ilo.org",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: "Link Five",
|
|
37
|
-
url: "https://www.ilo.org",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "Link Six",
|
|
28
|
+
label: "Contact us",
|
|
41
29
|
url: "https://www.ilo.org",
|
|
42
30
|
},
|
|
43
31
|
],
|
|
@@ -45,7 +33,7 @@ const basic: FooterProps = {
|
|
|
45
33
|
],
|
|
46
34
|
socialmedia: socialMediaArgs,
|
|
47
35
|
subscribe: {
|
|
48
|
-
label: "Subscribe",
|
|
36
|
+
label: "Subscribe for updates",
|
|
49
37
|
url: "https://www.ilo.org",
|
|
50
38
|
},
|
|
51
39
|
legal: "© 1996-2023 International Labour Organization (ILO)",
|
|
@@ -26,7 +26,7 @@ const Footer: FC<FooterProps> = ({
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<footer className={footerClasses}>
|
|
29
|
-
<div className={`${baseClass}--main`}>
|
|
29
|
+
<div className={`${baseClass}--main ${prefix}--container`}>
|
|
30
30
|
<div className="site--info">
|
|
31
31
|
<img className={`${baseClass}--logo`} src={logo} alt="ILO Logo" />
|
|
32
32
|
<h3 className={`${baseClass}--headline`}>{tagline}</h3>
|
|
@@ -46,47 +46,51 @@ const Footer: FC<FooterProps> = ({
|
|
|
46
46
|
<LinkList linkgroup={linkgroup} theme="dark"></LinkList>
|
|
47
47
|
</nav>
|
|
48
48
|
)}
|
|
49
|
-
{
|
|
49
|
+
{socialmedia && (
|
|
50
50
|
<div className="connect">
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
<div className="social--links">
|
|
52
|
+
<SocialMedia {...socialmedia} theme="dark" />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
{subscribe && (
|
|
57
|
+
<div className="subscribe">
|
|
58
|
+
<Button
|
|
59
|
+
label={subscribe?.label}
|
|
60
|
+
url={subscribe?.url}
|
|
61
|
+
type="primary"
|
|
62
|
+
size="large"
|
|
63
|
+
target="_blank"
|
|
64
|
+
></Button>
|
|
65
65
|
</div>
|
|
66
66
|
)}
|
|
67
67
|
</div>
|
|
68
68
|
<div className={`${baseClass}--secondary`}>
|
|
69
|
-
<div className=
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
<div className={`${prefix}--container`}>
|
|
70
|
+
<div className={`${baseClass}--secondary--details`}>
|
|
71
|
+
<div className="legal">{legal}</div>
|
|
72
|
+
{secondarylinks && (
|
|
73
|
+
<nav className="secondarylinks">
|
|
74
|
+
<ul className="secondarylinks--list">
|
|
75
|
+
{secondarylinks.map((link, i) => (
|
|
76
|
+
<li className="secondarylinks--list--item">
|
|
77
|
+
<a
|
|
78
|
+
key={i}
|
|
79
|
+
href={link.url}
|
|
80
|
+
className="secondarylinks--list--link"
|
|
81
|
+
>
|
|
82
|
+
{link?.label}
|
|
83
|
+
</a>
|
|
84
|
+
</li>
|
|
85
|
+
))}
|
|
86
|
+
</ul>
|
|
87
|
+
</nav>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
<a href={anchorlink?.url} className="anchorlink">
|
|
91
|
+
{anchorlink?.label}
|
|
92
|
+
</a>
|
|
93
|
+
</div>
|
|
90
94
|
</div>
|
|
91
95
|
</footer>
|
|
92
96
|
);
|
|
@@ -66,7 +66,7 @@ const Navigation: FC<NavigationProps> = ({
|
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
68
|
<div className={`${baseClass}--logo-bar`}>
|
|
69
|
-
<div className={`${baseClass}--inner`}>
|
|
69
|
+
<div className={`${baseClass}--inner ${prefix}--container`}>
|
|
70
70
|
<a href={siteurl} className={`${baseClass}--logo-link`}>
|
|
71
71
|
<img className={`${baseClass}--logo`} src={logo} alt="ILO Logo" />
|
|
72
72
|
</a>
|
|
@@ -82,7 +82,7 @@ const Navigation: FC<NavigationProps> = ({
|
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
84
|
<div className={`${baseClass}--navigation`}>
|
|
85
|
-
<div className={`${baseClass}--inner`}>
|
|
85
|
+
<div className={`${baseClass}--inner ${prefix}--container`}>
|
|
86
86
|
<div className={`${prefix}--mobile--nav`}>
|
|
87
87
|
<div className={`${prefix}--mobile--nav--logo`}>
|
|
88
88
|
<a href={siteurl} className={`${baseClass}--logo-link`}>
|
|
@@ -115,7 +115,7 @@ const Navigation: FC<NavigationProps> = ({
|
|
|
115
115
|
</button>
|
|
116
116
|
</div>
|
|
117
117
|
<div className={`${prefix}--mobile--nav--language--select`}>
|
|
118
|
-
<div className={`${baseClass}--inner`}>
|
|
118
|
+
<div className={`${baseClass}--inner ${prefix}--container`}>
|
|
119
119
|
<div className={`${prefix}--mobile--subnav--menu`}>
|
|
120
120
|
<button
|
|
121
121
|
className={`${prefix}--mobile--subnav--back`}
|
|
@@ -193,7 +193,7 @@ const Navigation: FC<NavigationProps> = ({
|
|
|
193
193
|
className={`${prefix}--subnav`}
|
|
194
194
|
aria-labelledby="secondary-navigation"
|
|
195
195
|
>
|
|
196
|
-
<div className={`${prefix}--subnav--inner`}>
|
|
196
|
+
<div className={`${prefix}--subnav--inner ${prefix}--container`}>
|
|
197
197
|
<div className={`${prefix}--mobile--subnav`}>
|
|
198
198
|
<div className={`${prefix}--mobile--subnav--menu`}>
|
|
199
199
|
<button
|
|
@@ -231,7 +231,7 @@ const Navigation: FC<NavigationProps> = ({
|
|
|
231
231
|
</nav>
|
|
232
232
|
)}
|
|
233
233
|
<div className={`${prefix}--search-box`}>
|
|
234
|
-
<div className={`${prefix}--header--inner`}>
|
|
234
|
+
<div className={`${prefix}--header--inner ${prefix}--container`}>
|
|
235
235
|
<SearchField
|
|
236
236
|
input={searchfield?.input}
|
|
237
237
|
action={searchfield?.action}
|
|
@@ -84,7 +84,8 @@ const Pagination: FC<PaginationProps> = ({
|
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
<p className={`${baseClass}--page`}>
|
|
87
|
-
<span>{currentPage + 1}</span>
|
|
87
|
+
<span>{currentPage + 1}</span>
|
|
88
|
+
<span>{pageCountPreposition}</span>
|
|
88
89
|
<span>{totalPages}</span>
|
|
89
90
|
</p>
|
|
90
91
|
|
package/src/components/index.ts
CHANGED
|
@@ -41,6 +41,6 @@ export { TableOfContents } from "./TableOfContents";
|
|
|
41
41
|
export { Footer } from "./Footer";
|
|
42
42
|
export { LocalNav } from "./LocalNav";
|
|
43
43
|
export { Navigation } from "./Navigation";
|
|
44
|
-
export {
|
|
44
|
+
export { CardGroup } from "./Cards/CardGroup";
|
|
45
45
|
export { Breadcrumb } from "./Breadcrumb";
|
|
46
46
|
export { Tabs } from "./Tabs";
|
package/src/types/index.ts
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var components_Cards_FeatureCard_index = require('./FeatureCard/index.js');
|
|
5
|
-
var components_Cards_DataCard_index = require('./DataCard/index.js');
|
|
6
|
-
var components_Cards_DetailCard_index = require('./DetailCard/index.js');
|
|
7
|
-
var components_Cards_FactlistCard_index = require('./FactlistCard/index.js');
|
|
8
|
-
var components_Cards_MultilinkCard_index = require('./MultilinkCard/index.js');
|
|
9
|
-
var components_Cards_PromoCard_index = require('./PromoCard/index.js');
|
|
10
|
-
var components_Cards_StatCard_index = require('./StatCard/index.js');
|
|
11
|
-
var components_Cards_TextCard_index = require('./TextCard/index.js');
|
|
12
|
-
require('classnames');
|
|
13
|
-
require('tslib');
|
|
14
|
-
require('react');
|
|
15
|
-
require('../../GlobalCtx-10114bdd.js');
|
|
16
|
-
require('../../hooks/useGlobalSettings.js');
|
|
17
|
-
require('../LinkList/LinkList.js');
|
|
18
|
-
require('../Link/Link.js');
|
|
19
|
-
require('../List/List.js');
|
|
20
|
-
require('../../ListCtx-14aa546f.js');
|
|
21
|
-
require('../List/ListItem.js');
|
|
22
|
-
require('../Profile/Profile.js');
|
|
23
|
-
|
|
24
|
-
const Card = (props) => {
|
|
25
|
-
const componentMap = {
|
|
26
|
-
data: components_Cards_DataCard_index,
|
|
27
|
-
detail: components_Cards_DetailCard_index,
|
|
28
|
-
factlist: components_Cards_FactlistCard_index,
|
|
29
|
-
featurecard: components_Cards_FeatureCard_index,
|
|
30
|
-
multilink: components_Cards_MultilinkCard_index,
|
|
31
|
-
promo: components_Cards_PromoCard_index,
|
|
32
|
-
stat: components_Cards_StatCard_index,
|
|
33
|
-
text: components_Cards_TextCard_index,
|
|
34
|
-
};
|
|
35
|
-
const { type } = props;
|
|
36
|
-
const SelectedCardComponent = componentMap[type] || components_Cards_FeatureCard_index;
|
|
37
|
-
return jsxRuntime.jsx(SelectedCardComponent, Object.assign({}, props));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
module.exports = Card;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('./FeatureCard/index.js');
|
|
4
|
-
require('./DataCard/index.js');
|
|
5
|
-
require('./DetailCard/index.js');
|
|
6
|
-
require('./FactlistCard/index.js');
|
|
7
|
-
require('./MultilinkCard/index.js');
|
|
8
|
-
require('./PromoCard/index.js');
|
|
9
|
-
require('./StatCard/index.js');
|
|
10
|
-
require('./TextCard/index.js');
|
|
11
|
-
var components_Cards_Card = require('./Card.js');
|
|
12
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
-
var classNames = require('classnames');
|
|
14
|
-
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
15
|
-
require('tslib');
|
|
16
|
-
require('react');
|
|
17
|
-
require('../../ListCtx-14aa546f.js');
|
|
18
|
-
require('../LinkList/LinkList.js');
|
|
19
|
-
require('../../GlobalCtx-10114bdd.js');
|
|
20
|
-
require('../Link/Link.js');
|
|
21
|
-
require('../List/List.js');
|
|
22
|
-
require('../List/ListItem.js');
|
|
23
|
-
require('../Profile/Profile.js');
|
|
24
|
-
|
|
25
|
-
const CardGroup = ({ cards, cardcount, cta }) => {
|
|
26
|
-
const { prefix } = hooks_useGlobalSettings();
|
|
27
|
-
const baseClass = `${prefix}--cardgroup`;
|
|
28
|
-
const cardGroupClasses = classNames(baseClass, `${baseClass}--${cardcount}`);
|
|
29
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: cardGroupClasses }, { children: [jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--inner` }, { children: cards &&
|
|
30
|
-
cards.map((card) => (jsxRuntime.jsx(components_Cards_Card, { title: card.title, image: card.image, intro: card.intro, eyebrow: card.eyebrow, date: card.date, dataset: card.dataset, link: card.link, profile: card.profile, cta: card.cta, source: card.source, listitems: card.listitems, linklist: card.linklist, color: card.color, theme: card.theme, cornercut: card.cornercut, alignment: card.alignment, type: card.type, size: card.size }))) })), cta && (jsxRuntime.jsx("div", Object.assign({ className: `${baseClass}--button-wrap` }, { children: jsxRuntime.jsx("a", Object.assign({ className: `${prefix}--button ${prefix}--button--medium ${prefix}--button--secondary`, href: cta.url }, { children: jsxRuntime.jsx("span", Object.assign({ className: "button__label" }, { children: cta.label })) })) })))] })));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
module.exports = CardGroup;
|