@ilo-org/react 0.11.0 → 0.12.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 +11 -0
- package/lib/cjs/components/Cards/Card.js +40 -0
- package/lib/cjs/components/Cards/CardGroup.js +33 -0
- package/lib/cjs/components/Cards/DataCard/index.js +27 -0
- package/lib/cjs/components/Cards/DetailCard/index.js +20 -0
- package/lib/cjs/components/Cards/FactlistCard/index.js +23 -0
- package/lib/cjs/components/Cards/FeatureCard/index.js +24 -0
- package/lib/cjs/components/Cards/MultilinkCard/index.js +24 -0
- package/lib/cjs/components/Cards/PromoCard/index.js +23 -0
- package/lib/cjs/components/Cards/StatCard/index.js +21 -0
- package/lib/cjs/components/Cards/TextCard/index.js +25 -0
- package/lib/cjs/components/Cards/index.js +37 -0
- package/lib/cjs/components/LinkList/LinkList.js +1 -1
- package/lib/cjs/components/index.js +12 -4
- package/lib/cjs/index.js +12 -4
- package/lib/esm/components/Cards/Card.js +38 -0
- package/lib/esm/components/{Card → Cards}/CardGroup.js +14 -6
- package/lib/esm/components/Cards/DataCard/index.js +25 -0
- package/lib/esm/components/Cards/DetailCard/index.js +18 -0
- package/lib/esm/components/Cards/FactlistCard/index.js +21 -0
- package/lib/esm/components/Cards/FeatureCard/index.js +22 -0
- package/lib/esm/components/Cards/MultilinkCard/index.js +22 -0
- package/lib/esm/components/Cards/PromoCard/index.js +21 -0
- package/lib/esm/components/Cards/StatCard/index.js +19 -0
- package/lib/esm/components/Cards/TextCard/index.js +23 -0
- package/lib/esm/components/Cards/index.js +22 -0
- package/lib/esm/components/LinkList/LinkList.js +1 -1
- package/lib/esm/components/index.js +10 -2
- package/lib/esm/index.js +10 -2
- package/lib/types/react/src/components/Cards/Card.props.d.ts +307 -0
- package/lib/types/react/src/components/{Card → Cards}/CardGroup.props.d.ts +1 -1
- package/lib/types/react/src/components/Cards/DataCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/DetailCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FactlistCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FeatureCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/MultilinkCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/PromoCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/StatCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/TextCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/index.d.ts +11 -0
- package/lib/types/react/src/components/index.d.ts +1 -1
- package/lib/types/react/src/types/index.d.ts +3 -3
- package/package.json +2 -2
- package/src/components/{Card → Cards}/Card.args.ts +41 -36
- package/src/components/Cards/Card.props.ts +382 -0
- package/src/components/Cards/Card.tsx +36 -0
- package/src/components/{Card → Cards}/CardGroup.args.ts +26 -26
- package/src/components/{Card → Cards}/CardGroup.props.ts +1 -1
- package/src/components/{Card → Cards}/CardGroup.tsx +12 -13
- package/src/components/Cards/DataCard/index.tsx +107 -0
- package/src/components/Cards/DetailCard/index.tsx +62 -0
- package/src/components/Cards/FactlistCard/index.tsx +42 -0
- package/src/components/Cards/FeatureCard/index.tsx +69 -0
- package/src/components/Cards/MultilinkCard/index.tsx +76 -0
- package/src/components/Cards/PromoCard/index.tsx +60 -0
- package/src/components/Cards/StatCard/index.tsx +36 -0
- package/src/components/Cards/TextCard/index.tsx +63 -0
- package/src/components/Cards/index.ts +22 -0
- package/src/components/LinkList/LinkList.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/types/index.ts +4 -4
- package/lib/cjs/components/Card/Card.js +0 -43
- package/lib/cjs/components/Card/CardGroup.js +0 -25
- package/lib/cjs/components/Card/index.js +0 -21
- package/lib/esm/components/Card/Card.js +0 -41
- package/lib/esm/components/Card/index.js +0 -14
- package/lib/types/react/src/components/Card/Card.props.d.ts +0 -110
- package/lib/types/react/src/components/Card/index.d.ts +0 -2
- package/src/components/Card/Card.props.ts +0 -142
- package/src/components/Card/Card.tsx +0 -183
- package/src/components/Card/index.ts +0 -2
- /package/lib/types/react/src/components/{Card → Cards}/Card.d.ts +0 -0
- /package/lib/types/react/src/components/{Card → Cards}/CardGroup.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import useGlobalSettings from '../../../hooks/useGlobalSettings.js';
|
|
4
|
+
import LinkList from '../../LinkList/LinkList.js';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../../GlobalCtx-7fb23cfa.js';
|
|
8
|
+
|
|
9
|
+
const MultilinkCard = ({ isvideo, eyebrow, title, size = "narrow", alignment, intro, link, linklist, image, }) => {
|
|
10
|
+
const { prefix } = useGlobalSettings();
|
|
11
|
+
const baseClass = `${prefix}--card`;
|
|
12
|
+
const cardClasses = classNames(baseClass, `${baseClass}__type__multilink`, {
|
|
13
|
+
[`${baseClass}__align__${alignment}`]: alignment,
|
|
14
|
+
[`${baseClass}__action`]: link,
|
|
15
|
+
[`${baseClass}__size__${size}`]: size,
|
|
16
|
+
[`${baseClass}__isvideo`]: isvideo,
|
|
17
|
+
[`${baseClass}__linklist`]: linklist,
|
|
18
|
+
});
|
|
19
|
+
return (jsxs("div", Object.assign({ className: cardClasses }, { children: [link && (jsx("a", Object.assign({ className: `${baseClass}--link`, href: link, title: title }, { children: jsx("span", Object.assign({ className: `${baseClass}--link--text` }, { children: title })) }))), jsxs("div", Object.assign({ className: `${baseClass}--wrap` }, { children: [image && (jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsx("picture", { children: jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [eyebrow && jsx("p", Object.assign({ className: `${baseClass}--eyebrow` }, { children: eyebrow })), title && jsx("h5", Object.assign({ className: `${baseClass}--title` }, { children: title })), image && (jsx("div", Object.assign({ className: `${baseClass}--image--wrapper` }, { children: jsx("picture", { children: jsx("img", { className: `${baseClass}--picture`, src: image, alt: title }) }) }))), intro && jsx("p", Object.assign({ className: `${baseClass}--intro` }, { children: intro })), linklist && (jsx(LinkList, { headline: linklist.headline, linkgroup: linklist.linkgroup }))] }))] }))] })));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { MultilinkCard as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import useGlobalSettings from '../../../hooks/useGlobalSettings.js';
|
|
4
|
+
import 'tslib';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '../../../GlobalCtx-7fb23cfa.js';
|
|
7
|
+
|
|
8
|
+
const PromoCard = ({ eyebrow, title, theme, size = "narrow", cornercut, intro, link, cta, }) => {
|
|
9
|
+
const { prefix } = useGlobalSettings();
|
|
10
|
+
const baseClass = `${prefix}--card`;
|
|
11
|
+
const wrapperClass = classNames(`${baseClass}--wrapper`, `${baseClass}--wrapper__type__promo ${baseClass}--wrapper__type__promo__size__${size}`);
|
|
12
|
+
const cardClasses = classNames(baseClass, `${baseClass}__type__promo`, {
|
|
13
|
+
[`${baseClass}__cornercut`]: cornercut,
|
|
14
|
+
[`${baseClass}__action`]: link,
|
|
15
|
+
[`${baseClass}__size__${size}`]: size,
|
|
16
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
17
|
+
});
|
|
18
|
+
return (jsx("div", Object.assign({ className: wrapperClass }, { children: jsxs("div", Object.assign({ className: cardClasses }, { children: [link && (jsx("a", Object.assign({ className: `${baseClass}--link`, href: link, title: title }, { children: jsx("span", Object.assign({ className: `${baseClass}--link--text` }, { children: title })) }))), jsx("div", Object.assign({ className: `${baseClass}--wrap` }, { children: jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [eyebrow && jsx("p", Object.assign({ className: `${baseClass}--eyebrow` }, { children: eyebrow })), title && jsx("h5", Object.assign({ className: `${baseClass}--title` }, { children: title })), intro && jsx("p", Object.assign({ className: `${baseClass}--intro` }, { children: intro })), cta && cta.label && (jsx("a", Object.assign({ className: `${baseClass}--cta ${prefix}--button ${prefix}--button--medium ${prefix}--button--primary`, href: cta.url }, { children: jsx("span", Object.assign({ className: "link__label" }, { children: cta.label })) })))] })) }))] })) })));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { PromoCard as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import useGlobalSettings from '../../../hooks/useGlobalSettings.js';
|
|
4
|
+
import Link from '../../Link/Link.js';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../../GlobalCtx-7fb23cfa.js';
|
|
8
|
+
|
|
9
|
+
const StatCard = ({ title, color, size = "standard", intro, source, }) => {
|
|
10
|
+
const { prefix } = useGlobalSettings();
|
|
11
|
+
const baseClass = `${prefix}--card`;
|
|
12
|
+
const cardClasses = classNames(baseClass, `${baseClass}__type__stat`, {
|
|
13
|
+
[`${baseClass}__color__${color}`]: color,
|
|
14
|
+
[`${baseClass}__size__${size}`]: size,
|
|
15
|
+
});
|
|
16
|
+
return (jsx("div", Object.assign({ className: cardClasses }, { children: jsx("div", Object.assign({ className: `${baseClass}--wrap` }, { children: jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [title && jsx("h5", Object.assign({ className: `${baseClass}--title` }, { children: title })), intro && jsx("p", Object.assign({ className: `${baseClass}--intro` }, { children: intro })), source && jsx(Link, Object.assign({ url: source.url }, { children: source.label }))] })) })) })));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { StatCard as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import useGlobalSettings from '../../../hooks/useGlobalSettings.js';
|
|
4
|
+
import Profile from '../../Profile/Profile.js';
|
|
5
|
+
import 'tslib';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../../GlobalCtx-7fb23cfa.js';
|
|
8
|
+
|
|
9
|
+
const TextCard = ({ eyebrow, title, theme, size, date, profile, link, }) => {
|
|
10
|
+
const { prefix } = useGlobalSettings();
|
|
11
|
+
const baseClass = `${prefix}--card`;
|
|
12
|
+
const wrapperClass = classNames(`${baseClass}--wrapper`);
|
|
13
|
+
const cardClasses = classNames(baseClass, `${baseClass}__type__text`, {
|
|
14
|
+
[`${baseClass}__action`]: link,
|
|
15
|
+
[`${baseClass}__size__${size}`]: size,
|
|
16
|
+
[`${baseClass}__theme__${theme}`]: theme,
|
|
17
|
+
});
|
|
18
|
+
console.log("heloo");
|
|
19
|
+
console.log(profile);
|
|
20
|
+
return (jsx("div", Object.assign({ className: wrapperClass }, { children: jsxs("div", Object.assign({ className: cardClasses }, { children: [link && (jsx("a", Object.assign({ className: `${baseClass}--link`, href: link, title: title }, { children: jsx("span", Object.assign({ className: `${baseClass}--link--text` }, { children: title })) }))), jsx("div", Object.assign({ className: `${baseClass}--wrap` }, { children: jsxs("div", Object.assign({ className: `${baseClass}--content` }, { children: [eyebrow && jsx("p", Object.assign({ className: `${baseClass}--eyebrow` }, { children: eyebrow })), title && jsx("h5", Object.assign({ className: `${baseClass}--title` }, { children: title })), date && (jsx("time", Object.assign({ className: `${baseClass}--date`, dateTime: date.unix }, { children: date.human }))), profile && profile.avatar && (jsx(Profile, { avatar: profile.avatar, description: profile.description, link: profile.link, name: profile.name, role: profile.role, className: `${prefix}--profile--contents--${theme}` }))] })) }))] })) })));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { TextCard as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as FeatureCard } from './FeatureCard/index.js';
|
|
2
|
+
export { default as DataCard } from './DataCard/index.js';
|
|
3
|
+
export { default as DetailCard } from './DetailCard/index.js';
|
|
4
|
+
export { default as FactlistCard } from './FactlistCard/index.js';
|
|
5
|
+
export { default as MultilinkCard } from './MultilinkCard/index.js';
|
|
6
|
+
export { default as PromoCard } from './PromoCard/index.js';
|
|
7
|
+
export { default as StatCard } from './StatCard/index.js';
|
|
8
|
+
export { default as TextCard } from './TextCard/index.js';
|
|
9
|
+
export { default as Card } from './Card.js';
|
|
10
|
+
export { default as CardGroup } from './CardGroup.js';
|
|
11
|
+
import 'react/jsx-runtime';
|
|
12
|
+
import 'classnames';
|
|
13
|
+
import '../../hooks/useGlobalSettings.js';
|
|
14
|
+
import 'tslib';
|
|
15
|
+
import 'react';
|
|
16
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
17
|
+
import '../LinkList/LinkList.js';
|
|
18
|
+
import '../Link/Link.js';
|
|
19
|
+
import '../List/List.js';
|
|
20
|
+
import '../../ListCtx-da435fdf.js';
|
|
21
|
+
import '../List/ListItem.js';
|
|
22
|
+
import '../Profile/Profile.js';
|
|
@@ -12,7 +12,7 @@ const LinkList = ({ className, headline, linkgroup, theme, }) => {
|
|
|
12
12
|
[baseClass]: true,
|
|
13
13
|
[`${baseClass + "--" + (theme && theme === "dark" ? theme : "light")}`]: true,
|
|
14
14
|
});
|
|
15
|
-
return (jsxs("div", Object.assign({ className: linkListClasses }, { children: [jsx("h3", Object.assign({ className: `${baseClass}--headline` }, { children: headline })), jsx("ul", Object.assign({ className: `${baseClass}--linkgroups` }, { children: linkgroup &&
|
|
15
|
+
return (jsxs("div", Object.assign({ className: linkListClasses }, { children: [headline && jsx("h3", Object.assign({ className: `${baseClass}--headline` }, { children: headline })), jsx("ul", Object.assign({ className: `${baseClass}--linkgroups` }, { children: linkgroup &&
|
|
16
16
|
linkgroup.map((linkset, i) => (jsxs("li", Object.assign({ className: `${baseClass}--linkgroups-item` }, { children: [linkset.headline && (jsx("h4", Object.assign({ className: `${baseClass}--links--headline` }, { children: linkset.headline }))), jsx("ul", Object.assign({ className: `${baseClass}--links` }, { children: linkset.links &&
|
|
17
17
|
linkset.links.map((link, i) => (jsx("li", Object.assign({ className: `${baseClass}--links--item${link.indented ? " indented" : ""}` }, { children: jsx("a", Object.assign({ href: link.url, className: `${baseClass}--link` }, { children: jsx("span", Object.assign({ className: `${baseClass}--label` }, { children: link.label })) })) }), `${baseClass}--links--item-${i}`))) }))] }), `${baseClass}--linkgroups-item-${i}`))) }))] })));
|
|
18
18
|
};
|
|
@@ -50,8 +50,8 @@ export { default as TableOfContents } from './TableOfContents/TableOfContents.js
|
|
|
50
50
|
export { default as Footer } from './Footer/Footer.js';
|
|
51
51
|
export { default as LocalNav } from './LocalNav/LocalNav.js';
|
|
52
52
|
export { default as Navigation } from './Navigation/Navigation.js';
|
|
53
|
-
export { default as Card } from './
|
|
54
|
-
export { default as CardGroup } from './
|
|
53
|
+
export { default as Card } from './Cards/Card.js';
|
|
54
|
+
export { default as CardGroup } from './Cards/CardGroup.js';
|
|
55
55
|
export { default as Breadcrumb } from './Breadcrumb/Breadcrumb.js';
|
|
56
56
|
export { default as Tabs } from './Tabs/Tabs.js';
|
|
57
57
|
import '../hooks/useGlobalSettings.js';
|
|
@@ -77,4 +77,12 @@ import 'videojs-youtube';
|
|
|
77
77
|
import 'video.js';
|
|
78
78
|
import '@ilo-org/icons-react';
|
|
79
79
|
import './Logo/Logo.js';
|
|
80
|
+
import './Cards/FeatureCard/index.js';
|
|
81
|
+
import './Cards/DataCard/index.js';
|
|
82
|
+
import './Cards/DetailCard/index.js';
|
|
83
|
+
import './Cards/FactlistCard/index.js';
|
|
80
84
|
import './List/ListItem.js';
|
|
85
|
+
import './Cards/MultilinkCard/index.js';
|
|
86
|
+
import './Cards/PromoCard/index.js';
|
|
87
|
+
import './Cards/StatCard/index.js';
|
|
88
|
+
import './Cards/TextCard/index.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -50,8 +50,8 @@ export { default as TableOfContents } from './components/TableOfContents/TableOf
|
|
|
50
50
|
export { default as Footer } from './components/Footer/Footer.js';
|
|
51
51
|
export { default as LocalNav } from './components/LocalNav/LocalNav.js';
|
|
52
52
|
export { default as Navigation } from './components/Navigation/Navigation.js';
|
|
53
|
-
export { default as Card } from './components/
|
|
54
|
-
export { default as CardGroup } from './components/
|
|
53
|
+
export { default as Card } from './components/Cards/Card.js';
|
|
54
|
+
export { default as CardGroup } from './components/Cards/CardGroup.js';
|
|
55
55
|
export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.js';
|
|
56
56
|
export { default as Tabs } from './components/Tabs/Tabs.js';
|
|
57
57
|
import './hooks/useGlobalSettings.js';
|
|
@@ -77,4 +77,12 @@ import './components/Video/VideoPlayer.js';
|
|
|
77
77
|
import 'videojs-youtube';
|
|
78
78
|
import 'video.js';
|
|
79
79
|
import './components/Logo/Logo.js';
|
|
80
|
+
import './components/Cards/FeatureCard/index.js';
|
|
81
|
+
import './components/Cards/DataCard/index.js';
|
|
82
|
+
import './components/Cards/DetailCard/index.js';
|
|
83
|
+
import './components/Cards/FactlistCard/index.js';
|
|
80
84
|
import './components/List/ListItem.js';
|
|
85
|
+
import './components/Cards/MultilinkCard/index.js';
|
|
86
|
+
import './components/Cards/PromoCard/index.js';
|
|
87
|
+
import './components/Cards/StatCard/index.js';
|
|
88
|
+
import './components/Cards/TextCard/index.js';
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { CardAlignment, ThemeTypes, CardCornerType, CardColor, CardSize, CardTypes } from "../../types";
|
|
2
|
+
import { LinkProps, LinkListProps } from "../LinkList/LinkList.props";
|
|
3
|
+
import { ProfileProps } from "../Profile/Profile.props";
|
|
4
|
+
export type DataCardProps = {
|
|
5
|
+
/**
|
|
6
|
+
* A line of text that appears as a small heading at the top of the card
|
|
7
|
+
*/
|
|
8
|
+
eyebrow?: string;
|
|
9
|
+
/**
|
|
10
|
+
* How big should the card be
|
|
11
|
+
*/
|
|
12
|
+
size?: Omit<CardSize, "standard">;
|
|
13
|
+
/**
|
|
14
|
+
* The image to show in the card
|
|
15
|
+
*/
|
|
16
|
+
image?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Array of Content (label, copy), Files object (optional headline, array of items with label and url) and Links * * object (optional headline, array of items with label and url)
|
|
19
|
+
*/
|
|
20
|
+
dataset?: CardDataset;
|
|
21
|
+
/**
|
|
22
|
+
* Make the content appear in one or two columns. Only applies when the size is set to `wide` or `fluid`
|
|
23
|
+
*/
|
|
24
|
+
columns?: string;
|
|
25
|
+
};
|
|
26
|
+
export type DetailCardProps = {
|
|
27
|
+
/**
|
|
28
|
+
* A line of text that appears as a small heading above the title of the card
|
|
29
|
+
*/
|
|
30
|
+
eyebrow?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The title of the card
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
35
|
+
/**
|
|
36
|
+
* Introductory text in the card
|
|
37
|
+
*/
|
|
38
|
+
intro?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Specify the event Date, in both human and Unix format.
|
|
41
|
+
*/
|
|
42
|
+
date?: EventDate;
|
|
43
|
+
/**
|
|
44
|
+
* Information about an event
|
|
45
|
+
*/
|
|
46
|
+
eventdetails?: string;
|
|
47
|
+
/**
|
|
48
|
+
* A URL to link to
|
|
49
|
+
*/
|
|
50
|
+
link?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The image to show in the card
|
|
53
|
+
*/
|
|
54
|
+
image?: string;
|
|
55
|
+
/**
|
|
56
|
+
* How big should the card be
|
|
57
|
+
*/
|
|
58
|
+
size?: Omit<CardSize, "standard">;
|
|
59
|
+
};
|
|
60
|
+
export type FactlistCardProps = {
|
|
61
|
+
/**
|
|
62
|
+
* The title of the card
|
|
63
|
+
*/
|
|
64
|
+
title: string;
|
|
65
|
+
/**
|
|
66
|
+
* Will render the card to appear on light or dark backgrounds
|
|
67
|
+
*/
|
|
68
|
+
theme?: ThemeTypes;
|
|
69
|
+
/**
|
|
70
|
+
* How big should the card be
|
|
71
|
+
*/
|
|
72
|
+
size?: Omit<CardSize, "standard">;
|
|
73
|
+
list?: string[];
|
|
74
|
+
};
|
|
75
|
+
export type FeatureCardProps = {
|
|
76
|
+
isvideo?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* A line of text that appears as a small heading above the title of the card
|
|
79
|
+
*/
|
|
80
|
+
eyebrow?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The title of the card
|
|
83
|
+
*/
|
|
84
|
+
title: string;
|
|
85
|
+
/**
|
|
86
|
+
* Will render the card to appear on light or dark backgrounds
|
|
87
|
+
*/
|
|
88
|
+
theme?: ThemeTypes;
|
|
89
|
+
/**
|
|
90
|
+
* How big should the card be
|
|
91
|
+
*/
|
|
92
|
+
size?: Omit<CardSize, "standard">;
|
|
93
|
+
/**
|
|
94
|
+
* Specify the event Date, in both human and Unix format.
|
|
95
|
+
*/
|
|
96
|
+
date?: EventDate;
|
|
97
|
+
link?: string;
|
|
98
|
+
linklist?: LinkListProps;
|
|
99
|
+
/**
|
|
100
|
+
* The image to show in the card
|
|
101
|
+
*/
|
|
102
|
+
image?: string;
|
|
103
|
+
};
|
|
104
|
+
export type MultilinkCardProps = {
|
|
105
|
+
isvideo?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* A line of text that appears as a small heading above the title of the card
|
|
108
|
+
*/
|
|
109
|
+
eyebrow?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The title of the card
|
|
112
|
+
*/
|
|
113
|
+
title: string;
|
|
114
|
+
/**
|
|
115
|
+
* How big should the card be
|
|
116
|
+
*/
|
|
117
|
+
size?: CardSize;
|
|
118
|
+
alignment?: CardAlignment;
|
|
119
|
+
intro?: string;
|
|
120
|
+
link?: string;
|
|
121
|
+
linklist?: LinkListProps;
|
|
122
|
+
/**
|
|
123
|
+
* The image to show in the card
|
|
124
|
+
*/
|
|
125
|
+
image?: string;
|
|
126
|
+
};
|
|
127
|
+
export type PromoCardProps = {
|
|
128
|
+
/**
|
|
129
|
+
* A line of text that appears as a small heading above the title of the card
|
|
130
|
+
*/
|
|
131
|
+
eyebrow?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The title of the card
|
|
134
|
+
*/
|
|
135
|
+
title: string;
|
|
136
|
+
/**
|
|
137
|
+
* Will render the card to appear on light or dark backgrounds
|
|
138
|
+
*/
|
|
139
|
+
theme?: ThemeTypes;
|
|
140
|
+
/**
|
|
141
|
+
* How big should the card be
|
|
142
|
+
*/
|
|
143
|
+
size?: CardSize;
|
|
144
|
+
/**
|
|
145
|
+
* Apply an optional corner cut to the top of the card
|
|
146
|
+
*/
|
|
147
|
+
cornercut?: CardCornerType;
|
|
148
|
+
/**
|
|
149
|
+
* Introductory text in the card
|
|
150
|
+
*/
|
|
151
|
+
intro?: string;
|
|
152
|
+
link?: string;
|
|
153
|
+
cta?: LinkProps;
|
|
154
|
+
};
|
|
155
|
+
export type StatCardProps = {
|
|
156
|
+
/**
|
|
157
|
+
* The title of the card
|
|
158
|
+
*/
|
|
159
|
+
title: string;
|
|
160
|
+
color?: CardColor;
|
|
161
|
+
/**
|
|
162
|
+
* How big should the card be
|
|
163
|
+
*/
|
|
164
|
+
size?: Omit<CardSize, "narrow" | "wide">;
|
|
165
|
+
/**
|
|
166
|
+
* Introductory text in the card
|
|
167
|
+
*/
|
|
168
|
+
intro?: string;
|
|
169
|
+
source?: LinkProps;
|
|
170
|
+
};
|
|
171
|
+
export type TextCardProps = {
|
|
172
|
+
/**
|
|
173
|
+
* A line of text that appears as a small heading above the title of the card
|
|
174
|
+
*/
|
|
175
|
+
eyebrow?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The title of the card
|
|
178
|
+
*/
|
|
179
|
+
title: string;
|
|
180
|
+
/**
|
|
181
|
+
* Will render the card to appear on light or dark backgrounds
|
|
182
|
+
*/
|
|
183
|
+
theme?: ThemeTypes;
|
|
184
|
+
/**
|
|
185
|
+
* How big should the card be
|
|
186
|
+
*/
|
|
187
|
+
size?: Omit<CardSize, "standard">;
|
|
188
|
+
/**
|
|
189
|
+
* Specify the event Date, in both human and Unix format.
|
|
190
|
+
*/
|
|
191
|
+
date?: EventDate;
|
|
192
|
+
profile: ProfileProps;
|
|
193
|
+
link?: string;
|
|
194
|
+
};
|
|
195
|
+
export interface CardProps {
|
|
196
|
+
/**
|
|
197
|
+
* Specify whether the card should display a video icon (for Feature card). Possible options: true | false
|
|
198
|
+
*/
|
|
199
|
+
isvideo?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Eyebrow field for the card.
|
|
202
|
+
*/
|
|
203
|
+
eyebrow: string;
|
|
204
|
+
/**
|
|
205
|
+
* Title field for the card
|
|
206
|
+
*/
|
|
207
|
+
title: string;
|
|
208
|
+
/**
|
|
209
|
+
* Color of the stat cards, options are turquoise | green| yellow| blue. Only used for stat cards.
|
|
210
|
+
*/
|
|
211
|
+
color?: CardColor;
|
|
212
|
+
/**
|
|
213
|
+
* The theme type for the card. Theme doesn't apply to these card types: Multilink, Data, Stat and Detail. Possible themes: light | dark.
|
|
214
|
+
*/
|
|
215
|
+
theme?: ThemeTypes;
|
|
216
|
+
/**
|
|
217
|
+
* Type - Sets the type of card to render.
|
|
218
|
+
Option keys: feature, text, detail, promo, multilink, data, stat, factlist
|
|
219
|
+
*/
|
|
220
|
+
type: CardTypes;
|
|
221
|
+
/**
|
|
222
|
+
* Size of the cards (usually reduces padding). `Wide` on Multilink and Feature cause a two column structure above a desktop breakpoint. Possible options: Wide | Standard | Narrow.
|
|
223
|
+
*/
|
|
224
|
+
size?: CardSize;
|
|
225
|
+
/**
|
|
226
|
+
* Specify whether the card has a cut corner. The only card that uses this setting are `Promo`.
|
|
227
|
+
*/
|
|
228
|
+
cornercut?: CardCornerType;
|
|
229
|
+
/**
|
|
230
|
+
* Specify whether a card image is right-aligned or left-aligned for `Multilink` cards. Possible options: left | right.
|
|
231
|
+
*/
|
|
232
|
+
alignment?: CardAlignment;
|
|
233
|
+
/**
|
|
234
|
+
* Intro text field for the card
|
|
235
|
+
*/
|
|
236
|
+
intro?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Specify the event Date, in both human and Unix format.
|
|
239
|
+
*/
|
|
240
|
+
date?: EventDate;
|
|
241
|
+
/**
|
|
242
|
+
* Event details for `Detail` card
|
|
243
|
+
*/
|
|
244
|
+
eventdetails?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Profile to embed in the card for `Text` card
|
|
247
|
+
*/
|
|
248
|
+
profile?: ProfileProps;
|
|
249
|
+
/**
|
|
250
|
+
* A list of text itmes to be embed in the card, specifically used in `Factlist` card.
|
|
251
|
+
*/
|
|
252
|
+
listitems?: Array<string>;
|
|
253
|
+
/**
|
|
254
|
+
* A Link behind a clickable card. Do no use on `Multilink`, `Factlist`, `Data`, or `Stat` cards.
|
|
255
|
+
*/
|
|
256
|
+
link?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Props of the LinkList component. Appears at the bottom of `Multilink` or `Feature` card.
|
|
259
|
+
*/
|
|
260
|
+
linklist?: LinkListProps;
|
|
261
|
+
/**
|
|
262
|
+
* Items for clickable CTA button, specifically used for `Promo` card.
|
|
263
|
+
*/
|
|
264
|
+
cta?: LinkProps;
|
|
265
|
+
/**
|
|
266
|
+
* The image used in a card. Images should be avoided on `Promo`, `Text`, `Factlist`, and `Stat` card.
|
|
267
|
+
*/
|
|
268
|
+
image?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Source link for `Stat` cards.
|
|
271
|
+
*/
|
|
272
|
+
source?: LinkProps;
|
|
273
|
+
/**
|
|
274
|
+
* Dataset object for the `Data` card. An array of Content (label, copy), Files (optional headline, array of items with label and url), and Links (optional headline, array of items with label and url).
|
|
275
|
+
*/
|
|
276
|
+
dataset?: CardDataset;
|
|
277
|
+
}
|
|
278
|
+
interface EventDate {
|
|
279
|
+
unix?: string;
|
|
280
|
+
human?: string;
|
|
281
|
+
}
|
|
282
|
+
interface CardDataset {
|
|
283
|
+
content?: DataContent;
|
|
284
|
+
files?: DataFile;
|
|
285
|
+
links?: DataLink;
|
|
286
|
+
cta?: Cta;
|
|
287
|
+
}
|
|
288
|
+
interface DataContent {
|
|
289
|
+
items?: Array<ContentItem>;
|
|
290
|
+
}
|
|
291
|
+
interface ContentItem {
|
|
292
|
+
label?: string;
|
|
293
|
+
copy?: string;
|
|
294
|
+
}
|
|
295
|
+
interface DataFile {
|
|
296
|
+
headline?: string;
|
|
297
|
+
items?: Array<LinkProps>;
|
|
298
|
+
}
|
|
299
|
+
interface DataLink {
|
|
300
|
+
headline?: string;
|
|
301
|
+
items?: Array<LinkProps>;
|
|
302
|
+
}
|
|
303
|
+
interface Cta {
|
|
304
|
+
headline?: string;
|
|
305
|
+
items?: Array<LinkProps>;
|
|
306
|
+
}
|
|
307
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import FeatureCard from "./FeatureCard";
|
|
2
|
+
import DataCard from "./DataCard";
|
|
3
|
+
import DetailCard from "./DetailCard";
|
|
4
|
+
import FactlistCard from "./FactlistCard";
|
|
5
|
+
import MultilinkCard from "./MultilinkCard";
|
|
6
|
+
import PromoCard from "./PromoCard";
|
|
7
|
+
import StatCard from "./StatCard";
|
|
8
|
+
import TextCard from "./TextCard";
|
|
9
|
+
export { FeatureCard, DataCard, DetailCard, FactlistCard, MultilinkCard, PromoCard, StatCard, TextCard, };
|
|
10
|
+
export { default as Card } from "./Card";
|
|
11
|
+
export { default as CardGroup } from "./CardGroup";
|
|
@@ -36,6 +36,6 @@ export { TableOfContents } from "./TableOfContents";
|
|
|
36
36
|
export { Footer } from "./Footer";
|
|
37
37
|
export { LocalNav } from "./LocalNav";
|
|
38
38
|
export { Navigation } from "./Navigation";
|
|
39
|
-
export { Card, CardGroup } from "./
|
|
39
|
+
export { Card, CardGroup } from "./Cards";
|
|
40
40
|
export { Breadcrumb } from "./Breadcrumb";
|
|
41
41
|
export { Tabs } from "./Tabs";
|
|
@@ -27,10 +27,10 @@ export type SizeTypes = "small" | "medium" | "large";
|
|
|
27
27
|
export type TagTypes = "anchor" | "display" | "button";
|
|
28
28
|
export type SocialTypes = "facebook" | "twitter" | "instagram" | "linkedin" | "youtube" | "tiktok" | "flickr";
|
|
29
29
|
export type CardColor = "turquoise" | "green" | "yellow" | "blue";
|
|
30
|
-
export type CardSize = "wide" | "standard" | "narrow";
|
|
31
|
-
export type CardCornerType =
|
|
30
|
+
export type CardSize = "wide" | "standard" | "narrow" | "fluid";
|
|
31
|
+
export type CardCornerType = boolean;
|
|
32
32
|
export type CardAlignment = "left" | "right";
|
|
33
|
-
export type CardTypes = "stat" | "multilink" | "
|
|
33
|
+
export type CardTypes = "stat" | "multilink" | "text" | "promo" | "feature" | "detail" | "factlist" | "data";
|
|
34
34
|
export interface FormFieldProps<T> {
|
|
35
35
|
/**
|
|
36
36
|
* The input's onChange callback.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "React components for the ILO's Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui_patterns",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"videojs-youtube": "^3.0.1",
|
|
78
78
|
"@ilo-org/brand-assets": "0.4.0",
|
|
79
79
|
"@ilo-org/fonts": "0.1.2",
|
|
80
|
+
"@ilo-org/styles": "0.14.2",
|
|
80
81
|
"@ilo-org/icons-react": "0.0.21",
|
|
81
|
-
"@ilo-org/styles": "0.14.1",
|
|
82
82
|
"@ilo-org/themes": "0.7.2",
|
|
83
83
|
"@ilo-org/utils": "0.0.11"
|
|
84
84
|
},
|