@ilo-org/react 0.12.0 → 0.14.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/.storybook/main.ts +41 -0
- package/.storybook/manager-head.html +92 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.tsx +81 -0
- package/.storybook/styles.scss +25 -0
- package/.storybook/theme.ts +46 -0
- package/.turbo/turbo-build:lib.log +15 -0
- package/CHANGELOG.md +43 -0
- package/lib/cjs/components/Cards/CardGroup/CardGroup.js +41 -0
- package/lib/cjs/components/Cards/CardGroup/index.js +796 -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 +22 -0
- package/lib/cjs/components/Cards/FactlistCard/index.js +16 -15
- 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/List/List.js +9 -11
- package/lib/cjs/components/List/ListItem.js +4 -7
- package/lib/cjs/components/List/index.js +1 -2
- 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 -13
- package/lib/cjs/index.js +10 -13
- package/lib/esm/components/Cards/CardGroup/CardGroup.js +39 -0
- package/lib/esm/components/Cards/CardGroup/index.js +793 -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 +20 -0
- package/lib/esm/components/Cards/FactlistCard/index.js +15 -15
- 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/List/List.js +10 -12
- package/lib/esm/components/List/ListItem.js +4 -7
- package/lib/esm/components/List/index.js +1 -2
- 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 -11
- package/lib/esm/index.js +9 -11
- 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/List/List.props.d.ts +2 -9
- package/lib/types/react/src/components/List/ListItem.props.d.ts +0 -6
- package/lib/types/react/src/components/index.d.ts +1 -1
- package/lib/types/react/src/types/index.d.ts +4 -2
- package/package.json +32 -12
- package/public/react.svg +8 -0
- package/rollup.config.mjs +2 -0
- package/src/__tests__/Accordion.test.tsx +16 -0
- package/src/__tests__/Button.test.tsx +60 -0
- package/src/__tests__/Callout.test.tsx +43 -0
- package/src/__tests__/ContextMenu.test.tsx +19 -0
- package/src/__tests__/Dropdown.test.tsx +38 -0
- package/src/__tests__/Heading.test.tsx +51 -0
- package/src/__tests__/Image.test.tsx +21 -0
- package/src/__tests__/LinkList.test.tsx +17 -0
- package/src/__tests__/List.test.tsx +25 -0
- package/src/__tests__/Loading.test.tsx +33 -0
- package/src/__tests__/Notification.test.tsx +39 -0
- package/src/__tests__/Pagination.test.tsx +58 -0
- package/src/__tests__/Profile.test.tsx +48 -0
- package/src/__tests__/ReadMore.test.tsx +43 -0
- package/src/__tests__/RichText.test.tsx +16 -0
- package/src/__tests__/SearchField.test.tsx +35 -0
- package/src/__tests__/TableOfContents.test.tsx +12 -0
- package/src/__tests__/Tag.test.tsx +10 -0
- package/src/components/Cards/{CardGroup.args.ts → CardGroup/CardGroup.args.ts} +299 -437
- 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/List/List.props.ts +2 -10
- package/src/components/List/List.tsx +17 -22
- package/src/components/List/ListItem.props.ts +0 -7
- package/src/components/List/ListItem.tsx +6 -11
- 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/setup.ts +6 -0
- package/src/stories/Accordion/Accordion.stories.tsx +145 -0
- package/src/stories/Breadcrumb/Breadcrumb.mdx +17 -0
- package/src/stories/Breadcrumb/Breadcrumb.stories.tsx +20 -0
- package/src/stories/Button/Button.mdx +94 -0
- package/src/stories/Button/Button.stories.tsx +68 -0
- package/src/stories/Callout/Callout.mdx +35 -0
- package/src/stories/Callout/Callout.stories.tsx +43 -0
- package/src/stories/Card/DataCard.stories.tsx +45 -0
- package/src/stories/Card/DetailCard.stories.tsx +41 -0
- package/src/stories/Card/FactlistCard.stories.tsx +48 -0
- package/src/stories/Card/FeatureCard.stories.tsx +56 -0
- package/src/stories/Card/MultilinkCard.stories.tsx +48 -0
- package/src/stories/Card/PromoCard.stories.tsx +48 -0
- package/src/stories/Card/StatCard.stories.tsx +45 -0
- package/src/stories/Card/TextCard.stories.tsx +45 -0
- package/src/stories/CardGroup/CardGroup.mdx +17 -0
- package/src/stories/CardGroup/CardGroup.stories.tsx +50 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +118 -0
- package/src/stories/ContextMenu/ContextMenu.stories.tsx +83 -0
- package/src/stories/DatePicker/DatePicker.stories.tsx +110 -0
- package/src/stories/Dropdown/Dropdown.stories.tsx +145 -0
- package/src/stories/Empty/Empty.stories.tsx +53 -0
- package/src/stories/Fieldset/Fieldset.stories.tsx +167 -0
- package/src/stories/FileUpload/FileUpload.stories.tsx +103 -0
- package/src/stories/Footer/Footer.mdx +17 -0
- package/src/stories/Footer/Footer.stories.tsx +15 -0
- package/src/stories/Form/Form.mdx +58 -0
- package/src/stories/Form/Form.stories.tsx +162 -0
- package/src/stories/GetStarted.mdx +57 -0
- package/src/stories/Heading/Heading.stories.tsx +193 -0
- package/src/stories/Hero/Hero.stories.tsx +68 -0
- package/src/stories/Image/Image.stories.tsx +50 -0
- package/src/stories/Link/Link.stories.tsx +81 -0
- package/src/stories/LinkList/LinkList.args.ts +190 -0
- package/src/stories/LinkList/LinkList.stories.tsx +60 -0
- package/src/stories/List/List.stories.tsx +167 -0
- package/src/stories/Loading/Loading.stories.tsx +97 -0
- package/src/stories/LocalNav/LocalNav.mdx +17 -0
- package/src/stories/LocalNav/LocalNav.stories.tsx +15 -0
- package/src/stories/Logo/Logo.stories.tsx +172 -0
- package/src/stories/LogoGrid/LogoGrid.stories.tsx +59 -0
- package/src/stories/Navigation/Navigation.mdx +17 -0
- package/src/stories/Navigation/Navigation.stories.tsx +15 -0
- package/src/stories/Notification/Notification.stories.tsx +187 -0
- package/src/stories/NumberPicker/NumberPicker.stories.tsx +69 -0
- package/src/stories/Pagination/Pagination.stories.tsx +86 -0
- package/src/stories/Profile/Profile.stories.tsx +64 -0
- package/src/stories/Radio/Radio.stories.tsx +232 -0
- package/src/stories/ReadMore/ReadMore.stories.tsx +59 -0
- package/src/stories/RichText/RichText.stories.tsx +63 -0
- package/src/stories/SearchField/SearchField.stories.tsx +91 -0
- package/src/stories/SocialMedia/SocialMedia.stories.tsx +60 -0
- package/src/stories/TableOfContents/TableOfContents.stories.tsx +55 -0
- package/src/stories/Tabs/Tabs.mdx +17 -0
- package/src/stories/Tabs/Tabs.stories.tsx +25 -0
- package/src/stories/Tag/Tag.stories.tsx +130 -0
- package/src/stories/TextInput/TextInput.stories.tsx +100 -0
- package/src/stories/Textarea/Textarea.stories.tsx +147 -0
- package/src/stories/Toggle/Toggle.stories.tsx +99 -0
- package/src/stories/Tooltip/Tooltip.stories.tsx +82 -0
- package/src/stories/Video/Video.stories.tsx +71 -0
- package/src/stories/Welcome.stories.mdx +37 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/welcome.scss +133 -0
- package/src/types/index.ts +6 -2
- package/lib/cjs/ListCtx-14aa546f.js +0 -9
- 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/ListCtx-da435fdf.js +0 -6
- 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/lib/types/react/src/components/List/ListCtx.d.ts +0 -4
- 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/src/components/List/ListCtx.ts +0 -7
- /package/lib/types/react/src/components/Cards/{CardGroup.d.ts → CardGroup/CardGroup.d.ts} +0 -0
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CardAlignment,
|
|
3
|
-
ThemeTypes,
|
|
4
|
-
CardCornerType,
|
|
5
|
-
CardColor,
|
|
6
|
-
CardSize,
|
|
7
|
-
CardTypes,
|
|
8
|
-
} from "../../types";
|
|
9
|
-
import { LinkProps, LinkListProps } from "../LinkList/LinkList.props";
|
|
10
|
-
import { ProfileProps } from "../Profile/Profile.props";
|
|
11
|
-
|
|
12
|
-
export type DataCardProps = {
|
|
13
|
-
/**
|
|
14
|
-
* A line of text that appears as a small heading at the top of the card
|
|
15
|
-
*/
|
|
16
|
-
eyebrow?: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* How big should the card be
|
|
20
|
-
*/
|
|
21
|
-
size?: Omit<CardSize, "standard">;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The image to show in the card
|
|
25
|
-
*/
|
|
26
|
-
image?: string;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 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)
|
|
30
|
-
*/
|
|
31
|
-
dataset?: CardDataset;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Make the content appear in one or two columns. Only applies when the size is set to `wide` or `fluid`
|
|
35
|
-
*/
|
|
36
|
-
columns?: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type DetailCardProps = {
|
|
40
|
-
/**
|
|
41
|
-
* A line of text that appears as a small heading above the title of the card
|
|
42
|
-
*/
|
|
43
|
-
eyebrow?: string;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The title of the card
|
|
47
|
-
*/
|
|
48
|
-
title: string;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Introductory text in the card
|
|
52
|
-
*/
|
|
53
|
-
intro?: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Specify the event Date, in both human and Unix format.
|
|
57
|
-
*/
|
|
58
|
-
date?: EventDate;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Information about an event
|
|
62
|
-
*/
|
|
63
|
-
eventdetails?: string;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* A URL to link to
|
|
67
|
-
*/
|
|
68
|
-
link?: string;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The image to show in the card
|
|
72
|
-
*/
|
|
73
|
-
image?: string;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* How big should the card be
|
|
77
|
-
*/
|
|
78
|
-
size?: Omit<CardSize, "standard">;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export type FactlistCardProps = {
|
|
82
|
-
/**
|
|
83
|
-
* The title of the card
|
|
84
|
-
*/
|
|
85
|
-
title: string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Will render the card to appear on light or dark backgrounds
|
|
89
|
-
*/
|
|
90
|
-
theme?: ThemeTypes;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* How big should the card be
|
|
94
|
-
*/
|
|
95
|
-
size?: Omit<CardSize, "standard">;
|
|
96
|
-
list?: string[];
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export type FeatureCardProps = {
|
|
100
|
-
isvideo?: boolean;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* A line of text that appears as a small heading above the title of the card
|
|
104
|
-
*/
|
|
105
|
-
eyebrow?: string;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The title of the card
|
|
109
|
-
*/
|
|
110
|
-
title: string;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Will render the card to appear on light or dark backgrounds
|
|
114
|
-
*/
|
|
115
|
-
theme?: ThemeTypes;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* How big should the card be
|
|
119
|
-
*/
|
|
120
|
-
size?: Omit<CardSize, "standard">;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Specify the event Date, in both human and Unix format.
|
|
124
|
-
*/
|
|
125
|
-
date?: EventDate;
|
|
126
|
-
link?: string;
|
|
127
|
-
linklist?: LinkListProps;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* The image to show in the card
|
|
131
|
-
*/
|
|
132
|
-
image?: string;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export type MultilinkCardProps = {
|
|
136
|
-
isvideo?: boolean;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* A line of text that appears as a small heading above the title of the card
|
|
140
|
-
*/
|
|
141
|
-
eyebrow?: string;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* The title of the card
|
|
145
|
-
*/
|
|
146
|
-
title: string;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* How big should the card be
|
|
150
|
-
*/
|
|
151
|
-
size?: CardSize;
|
|
152
|
-
alignment?: CardAlignment;
|
|
153
|
-
intro?: string;
|
|
154
|
-
link?: string;
|
|
155
|
-
linklist?: LinkListProps;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The image to show in the card
|
|
159
|
-
*/
|
|
160
|
-
image?: string;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export type PromoCardProps = {
|
|
164
|
-
/**
|
|
165
|
-
* A line of text that appears as a small heading above the title of the card
|
|
166
|
-
*/
|
|
167
|
-
eyebrow?: string;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* The title of the card
|
|
171
|
-
*/
|
|
172
|
-
title: string;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Will render the card to appear on light or dark backgrounds
|
|
176
|
-
*/
|
|
177
|
-
theme?: ThemeTypes;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* How big should the card be
|
|
181
|
-
*/
|
|
182
|
-
size?: CardSize;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Apply an optional corner cut to the top of the card
|
|
186
|
-
*/
|
|
187
|
-
cornercut?: CardCornerType;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Introductory text in the card
|
|
191
|
-
*/
|
|
192
|
-
intro?: string;
|
|
193
|
-
link?: string;
|
|
194
|
-
cta?: LinkProps;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export type StatCardProps = {
|
|
198
|
-
/**
|
|
199
|
-
* The title of the card
|
|
200
|
-
*/
|
|
201
|
-
title: string;
|
|
202
|
-
color?: CardColor;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* How big should the card be
|
|
206
|
-
*/
|
|
207
|
-
size?: Omit<CardSize, "narrow" | "wide">;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Introductory text in the card
|
|
211
|
-
*/
|
|
212
|
-
intro?: string;
|
|
213
|
-
source?: LinkProps;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export type TextCardProps = {
|
|
217
|
-
/**
|
|
218
|
-
* A line of text that appears as a small heading above the title of the card
|
|
219
|
-
*/
|
|
220
|
-
eyebrow?: string;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* The title of the card
|
|
224
|
-
*/
|
|
225
|
-
title: string;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Will render the card to appear on light or dark backgrounds
|
|
229
|
-
*/
|
|
230
|
-
theme?: ThemeTypes;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* How big should the card be
|
|
234
|
-
*/
|
|
235
|
-
size?: Omit<CardSize, "standard">;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Specify the event Date, in both human and Unix format.
|
|
239
|
-
*/
|
|
240
|
-
date?: EventDate;
|
|
241
|
-
profile: ProfileProps;
|
|
242
|
-
link?: string;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export interface CardProps {
|
|
246
|
-
/**
|
|
247
|
-
* Specify whether the card should display a video icon (for Feature card). Possible options: true | false
|
|
248
|
-
*/
|
|
249
|
-
isvideo?: boolean;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Eyebrow field for the card.
|
|
253
|
-
*/
|
|
254
|
-
eyebrow: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Title field for the card
|
|
258
|
-
*/
|
|
259
|
-
title: string;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Color of the stat cards, options are turquoise | green| yellow| blue. Only used for stat cards.
|
|
263
|
-
*/
|
|
264
|
-
color?: CardColor;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* The theme type for the card. Theme doesn't apply to these card types: Multilink, Data, Stat and Detail. Possible themes: light | dark.
|
|
268
|
-
*/
|
|
269
|
-
theme?: ThemeTypes;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Type - Sets the type of card to render.
|
|
273
|
-
Option keys: feature, text, detail, promo, multilink, data, stat, factlist
|
|
274
|
-
*/
|
|
275
|
-
type: CardTypes;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* 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.
|
|
279
|
-
*/
|
|
280
|
-
size?: CardSize;
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Specify whether the card has a cut corner. The only card that uses this setting are `Promo`.
|
|
284
|
-
*/
|
|
285
|
-
cornercut?: CardCornerType;
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Specify whether a card image is right-aligned or left-aligned for `Multilink` cards. Possible options: left | right.
|
|
289
|
-
*/
|
|
290
|
-
alignment?: CardAlignment;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Intro text field for the card
|
|
294
|
-
*/
|
|
295
|
-
intro?: string;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Specify the event Date, in both human and Unix format.
|
|
299
|
-
*/
|
|
300
|
-
date?: EventDate;
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Event details for `Detail` card
|
|
304
|
-
*/
|
|
305
|
-
eventdetails?: string;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Profile to embed in the card for `Text` card
|
|
309
|
-
*/
|
|
310
|
-
profile?: ProfileProps;
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* A list of text itmes to be embed in the card, specifically used in `Factlist` card.
|
|
314
|
-
*/
|
|
315
|
-
listitems?: Array<string>;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* A Link behind a clickable card. Do no use on `Multilink`, `Factlist`, `Data`, or `Stat` cards.
|
|
319
|
-
*/
|
|
320
|
-
link?: string;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Props of the LinkList component. Appears at the bottom of `Multilink` or `Feature` card.
|
|
324
|
-
*/
|
|
325
|
-
linklist?: LinkListProps;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Items for clickable CTA button, specifically used for `Promo` card.
|
|
329
|
-
*/
|
|
330
|
-
cta?: LinkProps;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* The image used in a card. Images should be avoided on `Promo`, `Text`, `Factlist`, and `Stat` card.
|
|
334
|
-
*/
|
|
335
|
-
image?: string;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Source link for `Stat` cards.
|
|
339
|
-
*/
|
|
340
|
-
source?: LinkProps;
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* 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).
|
|
344
|
-
*/
|
|
345
|
-
dataset?: CardDataset;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
interface EventDate {
|
|
349
|
-
unix?: string;
|
|
350
|
-
human?: string;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
interface CardDataset {
|
|
354
|
-
content?: DataContent;
|
|
355
|
-
files?: DataFile;
|
|
356
|
-
links?: DataLink;
|
|
357
|
-
cta?: Cta;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
interface DataContent {
|
|
361
|
-
items?: Array<ContentItem>;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
interface ContentItem {
|
|
365
|
-
label?: string;
|
|
366
|
-
copy?: string;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
interface DataFile {
|
|
370
|
-
headline?: string;
|
|
371
|
-
items?: Array<LinkProps>;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
interface DataLink {
|
|
375
|
-
headline?: string;
|
|
376
|
-
items?: Array<LinkProps>;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
interface Cta {
|
|
380
|
-
headline?: string;
|
|
381
|
-
items?: Array<LinkProps>;
|
|
382
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { CardProps } from "./Card.props";
|
|
3
|
-
import {
|
|
4
|
-
DataCard,
|
|
5
|
-
DetailCard,
|
|
6
|
-
FactlistCard,
|
|
7
|
-
FeatureCard,
|
|
8
|
-
MultilinkCard,
|
|
9
|
-
PromoCard,
|
|
10
|
-
StatCard,
|
|
11
|
-
TextCard,
|
|
12
|
-
} from ".";
|
|
13
|
-
|
|
14
|
-
type ComponentMap = {
|
|
15
|
-
[key: string]: FC<any>;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const Card: FC<CardProps> = (props: CardProps) => {
|
|
19
|
-
const componentMap: ComponentMap = {
|
|
20
|
-
data: DataCard,
|
|
21
|
-
detail: DetailCard,
|
|
22
|
-
factlist: FactlistCard,
|
|
23
|
-
featurecard: FeatureCard,
|
|
24
|
-
multilink: MultilinkCard,
|
|
25
|
-
promo: PromoCard,
|
|
26
|
-
stat: StatCard,
|
|
27
|
-
text: TextCard,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const { type } = props;
|
|
31
|
-
|
|
32
|
-
const SelectedCardComponent = componentMap[type] || FeatureCard;
|
|
33
|
-
return <SelectedCardComponent {...props} />;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default Card;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CardProps } from "./Card.props";
|
|
2
|
-
import { LinkProps } from "../LinkList/LinkList.props";
|
|
3
|
-
|
|
4
|
-
export interface CardGroupProps {
|
|
5
|
-
/**
|
|
6
|
-
* An array of card objects
|
|
7
|
-
*/
|
|
8
|
-
cards?: Required<CardProps>[];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Number of cards in the group
|
|
12
|
-
*/
|
|
13
|
-
cardcount: Required<string>;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A Button to display after all the cards in the group
|
|
17
|
-
*/
|
|
18
|
-
cta?: LinkProps;
|
|
19
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
-
import { CardGroupProps } from "./CardGroup.props";
|
|
5
|
-
import { Card } from ".";
|
|
6
|
-
|
|
7
|
-
const CardGroup: FC<CardGroupProps> = ({ cards, cardcount, cta }) => {
|
|
8
|
-
const { prefix } = useGlobalSettings();
|
|
9
|
-
|
|
10
|
-
const baseClass = `${prefix}--cardgroup`;
|
|
11
|
-
const cardGroupClasses = classnames(baseClass, `${baseClass}--${cardcount}`);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div className={cardGroupClasses}>
|
|
15
|
-
<div className={`${baseClass}--inner`}>
|
|
16
|
-
{cards &&
|
|
17
|
-
cards.map((card) => (
|
|
18
|
-
<Card
|
|
19
|
-
title={card.title}
|
|
20
|
-
image={card.image}
|
|
21
|
-
intro={card.intro}
|
|
22
|
-
eyebrow={card.eyebrow}
|
|
23
|
-
date={card.date}
|
|
24
|
-
dataset={card.dataset}
|
|
25
|
-
link={card.link}
|
|
26
|
-
profile={card.profile}
|
|
27
|
-
cta={card.cta}
|
|
28
|
-
source={card.source}
|
|
29
|
-
listitems={card.listitems}
|
|
30
|
-
linklist={card.linklist}
|
|
31
|
-
color={card.color}
|
|
32
|
-
theme={card.theme}
|
|
33
|
-
cornercut={card.cornercut}
|
|
34
|
-
alignment={card.alignment}
|
|
35
|
-
type={card.type}
|
|
36
|
-
size={card.size}
|
|
37
|
-
/>
|
|
38
|
-
))}
|
|
39
|
-
</div>
|
|
40
|
-
{cta && (
|
|
41
|
-
<div className={`${baseClass}--button-wrap`}>
|
|
42
|
-
<a
|
|
43
|
-
className={`${prefix}--button ${prefix}--button--medium ${prefix}--button--secondary`}
|
|
44
|
-
href={cta.url}
|
|
45
|
-
>
|
|
46
|
-
<span className="button__label">{cta.label}</span>
|
|
47
|
-
</a>
|
|
48
|
-
</div>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default CardGroup;
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
export {
|
|
11
|
-
FeatureCard,
|
|
12
|
-
DataCard,
|
|
13
|
-
DetailCard,
|
|
14
|
-
FactlistCard,
|
|
15
|
-
MultilinkCard,
|
|
16
|
-
PromoCard,
|
|
17
|
-
StatCard,
|
|
18
|
-
TextCard,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { default as Card } from "./Card";
|
|
22
|
-
export { default as CardGroup } from "./CardGroup";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
import { ListContextProps } from "./List.props";
|
|
3
|
-
import { ListItemContextProps } from "./ListItem.props";
|
|
4
|
-
|
|
5
|
-
export const ListContext = createContext({} as ListContextProps);
|
|
6
|
-
|
|
7
|
-
export const ListItemContext = createContext({} as ListItemContextProps);
|
|
File without changes
|