@ilo-org/react 0.10.6 → 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.
Files changed (246) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/lib/cjs/AccordionCtx-be704051.js +9 -0
  3. package/lib/cjs/{GlobalCtx-97e4b433.js → GlobalCtx-10114bdd.js} +2 -2
  4. package/lib/cjs/ListCtx-14aa546f.js +9 -0
  5. package/lib/cjs/TagCtx-690a1d54.js +7 -0
  6. package/lib/cjs/components/Accordion/Accordion.js +6 -6
  7. package/lib/cjs/components/Accordion/AccordionButton.js +5 -5
  8. package/lib/cjs/components/Accordion/AccordionItem.js +2 -2
  9. package/lib/cjs/components/Accordion/AccordionPanel.js +8 -8
  10. package/lib/cjs/components/Accordion/index.js +2 -2
  11. package/lib/cjs/components/Breadcrumb/Breadcrumb.js +5 -5
  12. package/lib/cjs/components/Breadcrumb/index.js +1 -1
  13. package/lib/cjs/components/Button/Button.js +1 -1
  14. package/lib/cjs/components/Button/index.js +1 -1
  15. package/lib/cjs/components/Callout/Callout.js +4 -4
  16. package/lib/cjs/components/Callout/index.js +1 -1
  17. package/lib/cjs/components/Cards/Card.js +40 -0
  18. package/lib/cjs/components/Cards/CardGroup.js +33 -0
  19. package/lib/cjs/components/Cards/DataCard/index.js +27 -0
  20. package/lib/cjs/components/Cards/DetailCard/index.js +20 -0
  21. package/lib/cjs/components/Cards/FactlistCard/index.js +23 -0
  22. package/lib/cjs/components/Cards/FeatureCard/index.js +24 -0
  23. package/lib/cjs/components/Cards/MultilinkCard/index.js +24 -0
  24. package/lib/cjs/components/Cards/PromoCard/index.js +23 -0
  25. package/lib/cjs/components/Cards/StatCard/index.js +21 -0
  26. package/lib/cjs/components/Cards/TextCard/index.js +25 -0
  27. package/lib/cjs/components/Cards/index.js +37 -0
  28. package/lib/cjs/components/Checkbox/Checkbox.js +5 -5
  29. package/lib/cjs/components/Checkbox/index.js +1 -1
  30. package/lib/cjs/components/Collapse/Collapse.js +1194 -44
  31. package/lib/cjs/components/Collapse/index.js +0 -1
  32. package/lib/cjs/components/ContextMenu/ContextMenu.js +1 -1
  33. package/lib/cjs/components/ContextMenu/index.js +1 -1
  34. package/lib/cjs/components/Credit/Credit.js +3 -3
  35. package/lib/cjs/components/Credit/index.js +1 -1
  36. package/lib/cjs/components/DatePicker/DatePicker.js +4 -4
  37. package/lib/cjs/components/DatePicker/index.js +1 -1
  38. package/lib/cjs/components/Dropdown/Dropdown.js +5 -5
  39. package/lib/cjs/components/Dropdown/index.js +1 -1
  40. package/lib/cjs/components/Empty/Empty.js +1 -1
  41. package/lib/cjs/components/Empty/index.js +1 -1
  42. package/lib/cjs/components/Fieldset/Fieldset.js +5 -5
  43. package/lib/cjs/components/Fieldset/index.js +1 -1
  44. package/lib/cjs/components/FileUpload/FileUpload.js +5 -5
  45. package/lib/cjs/components/FileUpload/index.js +1 -1
  46. package/lib/cjs/components/Footer/Footer.js +1 -1
  47. package/lib/cjs/components/Footer/index.js +1 -1
  48. package/lib/cjs/components/Form/Form.js +3 -3
  49. package/lib/cjs/components/Form/index.js +1 -1
  50. package/lib/cjs/components/FormControl/FormControl.js +7 -7
  51. package/lib/cjs/components/FormControl/index.js +1 -1
  52. package/lib/cjs/components/GlobalProvider/GlobalProvider.js +1 -1
  53. package/lib/cjs/components/GlobalProvider/index.js +1 -1
  54. package/lib/cjs/components/Heading/Heading.js +1 -1
  55. package/lib/cjs/components/Heading/index.js +1 -1
  56. package/lib/cjs/components/Hero/Hero.js +1 -1
  57. package/lib/cjs/components/Hero/HeroCard.js +1 -1
  58. package/lib/cjs/components/Hero/index.js +1 -1
  59. package/lib/cjs/components/Icon/Icon.js +3 -3
  60. package/lib/cjs/components/Icon/index.js +1 -1
  61. package/lib/cjs/components/Image/Image.js +1 -1
  62. package/lib/cjs/components/Image/index.js +1 -1
  63. package/lib/cjs/components/Input/Input.js +1 -1
  64. package/lib/cjs/components/Input/index.js +1 -1
  65. package/lib/cjs/components/Link/Link.js +1 -1
  66. package/lib/cjs/components/Link/index.js +1 -1
  67. package/lib/cjs/components/LinkList/LinkList.js +2 -2
  68. package/lib/cjs/components/LinkList/index.js +1 -1
  69. package/lib/cjs/components/List/List.js +4 -4
  70. package/lib/cjs/components/List/ListItem.js +2 -2
  71. package/lib/cjs/components/List/index.js +2 -2
  72. package/lib/cjs/components/Loading/Loading.js +1 -1
  73. package/lib/cjs/components/Loading/index.js +1 -1
  74. package/lib/cjs/components/LocalNav/LocalNav.js +4 -4
  75. package/lib/cjs/components/LocalNav/index.js +1 -1
  76. package/lib/cjs/components/Logo/Logo.js +15 -15
  77. package/lib/cjs/components/Logo/index.js +1 -1
  78. package/lib/cjs/components/LogoGrid/LogoGrid.js +1 -1
  79. package/lib/cjs/components/LogoGrid/index.js +1 -1
  80. package/lib/cjs/components/Navigation/Navigation.js +6 -6
  81. package/lib/cjs/components/Navigation/index.js +1 -1
  82. package/lib/cjs/components/Notification/Notification.js +3 -3
  83. package/lib/cjs/components/Notification/index.js +1 -1
  84. package/lib/cjs/components/NumberPicker/NumberPicker.js +4 -4
  85. package/lib/cjs/components/NumberPicker/index.js +1 -1
  86. package/lib/cjs/components/Pagination/Pagination.js +1 -1
  87. package/lib/cjs/components/Pagination/index.js +1 -1
  88. package/lib/cjs/components/Profile/Profile.js +1 -1
  89. package/lib/cjs/components/Profile/index.js +1 -1
  90. package/lib/cjs/components/Radio/Radio.js +5 -5
  91. package/lib/cjs/components/Radio/index.js +1 -1
  92. package/lib/cjs/components/ReadMore/ReadMore.js +4 -4
  93. package/lib/cjs/components/ReadMore/index.js +1 -1
  94. package/lib/cjs/components/RichText/RichText.js +1 -1
  95. package/lib/cjs/components/RichText/index.js +1 -1
  96. package/lib/cjs/components/SearchField/SearchField.js +3 -3
  97. package/lib/cjs/components/SearchField/index.js +1 -1
  98. package/lib/cjs/components/SocialMedia/SocialMedia.js +1 -1
  99. package/lib/cjs/components/SocialMedia/index.js +1 -1
  100. package/lib/cjs/components/TableOfContents/TableOfContents.js +1 -1
  101. package/lib/cjs/components/TableOfContents/index.js +1 -1
  102. package/lib/cjs/components/Tabs/Tabs.args.js +156 -0
  103. package/lib/cjs/components/Tabs/Tabs.js +24 -0
  104. package/lib/cjs/components/Tabs/index.js +15 -0
  105. package/lib/cjs/components/Tag/Tag.js +4 -4
  106. package/lib/cjs/components/Tag/TagSet.js +6 -6
  107. package/lib/cjs/components/Tag/index.js +2 -2
  108. package/lib/cjs/components/TextInput/TextInput.js +4 -4
  109. package/lib/cjs/components/TextInput/index.js +1 -1
  110. package/lib/cjs/components/Textarea/Textarea.js +4 -4
  111. package/lib/cjs/components/Textarea/index.js +1 -1
  112. package/lib/cjs/components/Toggle/Toggle.js +4 -4
  113. package/lib/cjs/components/Toggle/index.js +1 -1
  114. package/lib/cjs/components/Tooltip/Tooltip.js +5 -5
  115. package/lib/cjs/components/Tooltip/index.js +1 -1
  116. package/lib/cjs/components/Video/Video.js +11 -12
  117. package/lib/cjs/components/Video/VideoPlayer.js +55 -13
  118. package/lib/cjs/components/Video/index.js +6 -8
  119. package/lib/cjs/components/index.js +21 -12
  120. package/lib/cjs/hooks/index.js +1 -1
  121. package/lib/cjs/hooks/useGlobalSettings.js +3 -3
  122. package/lib/cjs/hooks/usePrevious.js +3 -3
  123. package/lib/cjs/hooks/useVideoPlayer.js +7 -7
  124. package/lib/cjs/index.js +21 -12
  125. package/lib/esm/components/Cards/Card.js +38 -0
  126. package/lib/esm/components/{Card → Cards}/CardGroup.js +14 -6
  127. package/lib/esm/components/Cards/DataCard/index.js +25 -0
  128. package/lib/esm/components/Cards/DetailCard/index.js +18 -0
  129. package/lib/esm/components/Cards/FactlistCard/index.js +21 -0
  130. package/lib/esm/components/Cards/FeatureCard/index.js +22 -0
  131. package/lib/esm/components/Cards/MultilinkCard/index.js +22 -0
  132. package/lib/esm/components/Cards/PromoCard/index.js +21 -0
  133. package/lib/esm/components/Cards/StatCard/index.js +19 -0
  134. package/lib/esm/components/Cards/TextCard/index.js +23 -0
  135. package/lib/esm/components/Cards/index.js +22 -0
  136. package/lib/esm/components/Collapse/Collapse.js +1156 -6
  137. package/lib/esm/components/Collapse/index.js +0 -1
  138. package/lib/esm/components/FileUpload/FileUpload.js +3 -3
  139. package/lib/esm/components/LinkList/LinkList.js +1 -1
  140. package/lib/esm/components/NumberPicker/NumberPicker.js +3 -3
  141. package/lib/esm/components/Radio/Radio.js +3 -3
  142. package/lib/esm/components/Tabs/Tabs.args.js +154 -0
  143. package/lib/esm/components/Tabs/Tabs.js +22 -0
  144. package/lib/esm/components/Tabs/index.js +9 -0
  145. package/lib/esm/components/TextInput/TextInput.js +3 -3
  146. package/lib/esm/components/Textarea/Textarea.js +3 -3
  147. package/lib/esm/components/Video/Video.js +10 -11
  148. package/lib/esm/components/Video/VideoPlayer.js +57 -11
  149. package/lib/esm/components/Video/index.js +5 -7
  150. package/lib/esm/components/index.js +14 -6
  151. package/lib/esm/index.js +14 -6
  152. package/lib/types/react/src/components/Cards/Card.props.d.ts +307 -0
  153. package/lib/types/react/src/components/{Card → Cards}/CardGroup.props.d.ts +1 -1
  154. package/lib/types/react/src/components/Cards/DataCard/index.d.ts +4 -0
  155. package/lib/types/react/src/components/Cards/DetailCard/index.d.ts +4 -0
  156. package/lib/types/react/src/components/Cards/FactlistCard/index.d.ts +4 -0
  157. package/lib/types/react/src/components/Cards/FeatureCard/index.d.ts +4 -0
  158. package/lib/types/react/src/components/Cards/MultilinkCard/index.d.ts +4 -0
  159. package/lib/types/react/src/components/Cards/PromoCard/index.d.ts +4 -0
  160. package/lib/types/react/src/components/Cards/StatCard/index.d.ts +4 -0
  161. package/lib/types/react/src/components/Cards/TextCard/index.d.ts +4 -0
  162. package/lib/types/react/src/components/Cards/index.d.ts +11 -0
  163. package/lib/types/react/src/components/Tabs/Tabs.args.d.ts +10 -0
  164. package/lib/types/react/src/components/Tabs/Tabs.d.ts +4 -0
  165. package/lib/types/react/src/components/Tabs/Tabs.props.d.ts +12 -0
  166. package/lib/types/react/src/components/Tabs/index.d.ts +1 -0
  167. package/lib/types/react/src/components/Video/Video.d.ts +2 -2
  168. package/lib/types/react/src/components/Video/Video.props.d.ts +5 -43
  169. package/lib/types/react/src/components/Video/VideoPlayer.d.ts +3 -3
  170. package/lib/types/react/src/components/Video/VideoPlayer.props.d.ts +6 -31
  171. package/lib/types/react/src/components/index.d.ts +2 -1
  172. package/lib/types/react/src/types/index.d.ts +3 -3
  173. package/package.json +9 -7
  174. package/src/components/{Card → Cards}/Card.args.ts +41 -36
  175. package/src/components/Cards/Card.props.ts +382 -0
  176. package/src/components/Cards/Card.tsx +36 -0
  177. package/src/components/{Card → Cards}/CardGroup.args.ts +26 -26
  178. package/src/components/{Card → Cards}/CardGroup.props.ts +1 -1
  179. package/src/components/{Card → Cards}/CardGroup.tsx +12 -13
  180. package/src/components/Cards/DataCard/index.tsx +107 -0
  181. package/src/components/Cards/DetailCard/index.tsx +62 -0
  182. package/src/components/Cards/FactlistCard/index.tsx +42 -0
  183. package/src/components/Cards/FeatureCard/index.tsx +69 -0
  184. package/src/components/Cards/MultilinkCard/index.tsx +76 -0
  185. package/src/components/Cards/PromoCard/index.tsx +60 -0
  186. package/src/components/Cards/StatCard/index.tsx +36 -0
  187. package/src/components/Cards/TextCard/index.tsx +63 -0
  188. package/src/components/Cards/index.ts +22 -0
  189. package/src/components/LinkList/LinkList.tsx +1 -1
  190. package/src/components/Tabs/Tabs.args.tsx +201 -0
  191. package/src/components/Tabs/Tabs.props.ts +13 -0
  192. package/src/components/Tabs/Tabs.tsx +60 -0
  193. package/src/components/Tabs/index.ts +1 -0
  194. package/src/components/Video/Video.args.ts +18 -24
  195. package/src/components/Video/Video.props.ts +5 -47
  196. package/src/components/Video/Video.tsx +24 -19
  197. package/src/components/Video/VideoPlayer.props.ts +7 -38
  198. package/src/components/Video/VideoPlayer.tsx +67 -322
  199. package/src/components/index.ts +2 -1
  200. package/src/declarations.d.ts +22 -0
  201. package/src/types/index.ts +4 -4
  202. package/lib/cjs/AccordionCtx-fe08ff45.js +0 -9
  203. package/lib/cjs/DailyMotion-17b56ecb.js +0 -259
  204. package/lib/cjs/Facebook-0c8d86ee.js +0 -239
  205. package/lib/cjs/FilePlayer-01d6dc08.js +0 -596
  206. package/lib/cjs/Kaltura-40e8e581.js +0 -235
  207. package/lib/cjs/ListCtx-7db7fe04.js +0 -9
  208. package/lib/cjs/Mixcloud-e23f49d6.js +0 -222
  209. package/lib/cjs/Preview-8e490f54.js +0 -227
  210. package/lib/cjs/SoundCloud-2500b6cb.js +0 -249
  211. package/lib/cjs/Streamable-00723065.js +0 -234
  212. package/lib/cjs/TagCtx-929c7753.js +0 -7
  213. package/lib/cjs/Twitch-2c5c5733.js +0 -244
  214. package/lib/cjs/VideoPlayer-5f0a64c6.js +0 -2067
  215. package/lib/cjs/Vidyard-d36d6c45.js +0 -237
  216. package/lib/cjs/Vimeo-d311e3b8.js +0 -285
  217. package/lib/cjs/Wistia-318b4e43.js +0 -288
  218. package/lib/cjs/YouTube-a3796a55.js +0 -377
  219. package/lib/cjs/components/Card/Card.js +0 -43
  220. package/lib/cjs/components/Card/CardGroup.js +0 -25
  221. package/lib/cjs/components/Card/index.js +0 -21
  222. package/lib/cjs/index-0af02e81.js +0 -1154
  223. package/lib/esm/DailyMotion-989c2db3.js +0 -257
  224. package/lib/esm/Facebook-04e9cc59.js +0 -237
  225. package/lib/esm/FilePlayer-0789336d.js +0 -594
  226. package/lib/esm/Kaltura-a9ed37a9.js +0 -233
  227. package/lib/esm/Mixcloud-5a3b4353.js +0 -220
  228. package/lib/esm/Preview-7ca1835e.js +0 -225
  229. package/lib/esm/SoundCloud-47bccd79.js +0 -247
  230. package/lib/esm/Streamable-ee762126.js +0 -232
  231. package/lib/esm/Twitch-3cd4b54b.js +0 -242
  232. package/lib/esm/VideoPlayer-96c2b20c.js +0 -2062
  233. package/lib/esm/Vidyard-258ab0ef.js +0 -235
  234. package/lib/esm/Vimeo-4b29b580.js +0 -283
  235. package/lib/esm/Wistia-3cbce669.js +0 -286
  236. package/lib/esm/YouTube-db52da1c.js +0 -375
  237. package/lib/esm/components/Card/Card.js +0 -41
  238. package/lib/esm/components/Card/index.js +0 -14
  239. package/lib/esm/index-623ce3f5.js +0 -1152
  240. package/lib/types/react/src/components/Card/Card.props.d.ts +0 -110
  241. package/lib/types/react/src/components/Card/index.d.ts +0 -2
  242. package/src/components/Card/Card.props.ts +0 -142
  243. package/src/components/Card/Card.tsx +0 -183
  244. package/src/components/Card/index.ts +0 -2
  245. /package/lib/types/react/src/components/{Card → Cards}/Card.d.ts +0 -0
  246. /package/lib/types/react/src/components/{Card → Cards}/CardGroup.d.ts +0 -0
@@ -1,110 +0,0 @@
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 interface CardProps {
5
- /**
6
- * Specify whether the card should display a video icon (for Feature card). Possible options: true | false
7
- */
8
- isvideo?: boolean;
9
- /**
10
- * Eyebrow field for the card.
11
- */
12
- eyebrow: Required<string>;
13
- /**
14
- * Title field for the card
15
- */
16
- title: Required<string>;
17
- /**
18
- * Color of the stat cards, options are turquoise | green| yellow| blue. Only used for stat cards.
19
- */
20
- color?: CardColor;
21
- /**
22
- * The theme type for the card. Theme doesn't apply to these card types: Multilink, Data, Stat and Detail. Possible themes: light | dark.
23
- */
24
- theme?: ThemeTypes;
25
- /**
26
- * Different variations of card: Graphic | Stat | Graphic Promo | Multilink | Feature | Detail | Fact List | Data.
27
- */
28
- variant: Required<CardTypes>;
29
- /**
30
- * 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.
31
- */
32
- size?: CardSize;
33
- /**
34
- * Specify whether the card has a cut corner. The only cards that use this setting are `Graphic Promo` and `Factlist`. Possible options: cornercut | corner.
35
- */
36
- cornercut?: CardCornerType;
37
- /**
38
- * Specify whether a card image is right-aligned or left-aligned for `Multilink` cards. Possible options: left | right.
39
- */
40
- alignment?: CardAlignment;
41
- /**
42
- * Intro text field for the card
43
- */
44
- intro?: string;
45
- /**
46
- * Specify the event Date, in both human and Unix format.
47
- */
48
- date?: EventDate;
49
- /**
50
- * Event details for `Detail` card
51
- */
52
- eventdetails?: string;
53
- /**
54
- * Profile to embed in the card for `Graphic Text`
55
- */
56
- profile?: ProfileProps;
57
- /**
58
- * A list of text itmes to be embed in the card, specifically used in `Factlist` card.
59
- */
60
- listitems?: Array<string>;
61
- /**
62
- * A Link behind a clickable card. Do no use on `Multilink`, `Factlist`, `Data`, or `Stat` cards.
63
- */
64
- link?: string;
65
- /**
66
- * Props of the LinkList component. Appears at the bottom of `Multilink` or `Feature` card.
67
- */
68
- linklist?: LinkListProps;
69
- /**
70
- * Items for clickable CTA button, specifically used for `Graphic Promo` card.
71
- */
72
- cta?: LinkProps;
73
- /**
74
- * The image used in a card. Images should be avoided on `Graphic Promo`, `Graphic Text`, `Factlist`, and `Stat` card.
75
- */
76
- image?: string;
77
- /**
78
- * Source link for `Stat` cards.
79
- */
80
- source?: LinkProps;
81
- /**
82
- * 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).
83
- */
84
- dataset?: CardDataset;
85
- }
86
- interface EventDate {
87
- unix?: string;
88
- human?: string;
89
- }
90
- interface CardDataset {
91
- content?: DataContent;
92
- files?: DataFile;
93
- links?: DataLink;
94
- }
95
- interface DataContent {
96
- items?: Array<ContentItem>;
97
- }
98
- interface ContentItem {
99
- label?: string;
100
- copy?: string;
101
- }
102
- interface DataFile {
103
- headline?: string;
104
- items?: Array<LinkProps>;
105
- }
106
- interface DataLink {
107
- headline?: string;
108
- items?: Array<LinkProps>;
109
- }
110
- export {};
@@ -1,2 +0,0 @@
1
- export { default as Card } from "./Card";
2
- export { default as CardGroup } from "./CardGroup";
@@ -1,142 +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 interface CardProps {
13
- /**
14
- * Specify whether the card should display a video icon (for Feature card). Possible options: true | false
15
- */
16
- isvideo?: boolean;
17
-
18
- /**
19
- * Eyebrow field for the card.
20
- */
21
- eyebrow: Required<string>;
22
-
23
- /**
24
- * Title field for the card
25
- */
26
- title: Required<string>;
27
-
28
- /**
29
- * Color of the stat cards, options are turquoise | green| yellow| blue. Only used for stat cards.
30
- */
31
- color?: CardColor;
32
-
33
- /**
34
- * The theme type for the card. Theme doesn't apply to these card types: Multilink, Data, Stat and Detail. Possible themes: light | dark.
35
- */
36
- theme?: ThemeTypes;
37
-
38
- /**
39
- * Different variations of card: Graphic | Stat | Graphic Promo | Multilink | Feature | Detail | Fact List | Data.
40
- */
41
- variant: Required<CardTypes>;
42
-
43
- /**
44
- * 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.
45
- */
46
- size?: CardSize;
47
-
48
- /**
49
- * Specify whether the card has a cut corner. The only cards that use this setting are `Graphic Promo` and `Factlist`. Possible options: cornercut | corner.
50
- */
51
- cornercut?: CardCornerType;
52
-
53
- /**
54
- * Specify whether a card image is right-aligned or left-aligned for `Multilink` cards. Possible options: left | right.
55
- */
56
- alignment?: CardAlignment;
57
-
58
- /**
59
- * Intro text field for the card
60
- */
61
- intro?: string;
62
-
63
- /**
64
- * Specify the event Date, in both human and Unix format.
65
- */
66
- date?: EventDate;
67
-
68
- /**
69
- * Event details for `Detail` card
70
- */
71
- eventdetails?: string;
72
-
73
- /**
74
- * Profile to embed in the card for `Graphic Text`
75
- */
76
- profile?: ProfileProps;
77
-
78
- /**
79
- * A list of text itmes to be embed in the card, specifically used in `Factlist` card.
80
- */
81
- listitems?: Array<string>;
82
-
83
- /**
84
- * A Link behind a clickable card. Do no use on `Multilink`, `Factlist`, `Data`, or `Stat` cards.
85
- */
86
- link?: string;
87
-
88
- /**
89
- * Props of the LinkList component. Appears at the bottom of `Multilink` or `Feature` card.
90
- */
91
- linklist?: LinkListProps;
92
-
93
- /**
94
- * Items for clickable CTA button, specifically used for `Graphic Promo` card.
95
- */
96
- cta?: LinkProps;
97
-
98
- /**
99
- * The image used in a card. Images should be avoided on `Graphic Promo`, `Graphic Text`, `Factlist`, and `Stat` card.
100
- */
101
- image?: string;
102
-
103
- /**
104
- * Source link for `Stat` cards.
105
- */
106
- source?: LinkProps;
107
-
108
- /**
109
- * 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).
110
- */
111
- dataset?: CardDataset;
112
- }
113
-
114
- interface EventDate {
115
- unix?: string;
116
- human?: string;
117
- }
118
-
119
- interface CardDataset {
120
- content?: DataContent;
121
- files?: DataFile;
122
- links?: DataLink;
123
- }
124
-
125
- interface DataContent {
126
- items?: Array<ContentItem>;
127
- }
128
-
129
- interface ContentItem {
130
- label?: string;
131
- copy?: string;
132
- }
133
-
134
- interface DataFile {
135
- headline?: string;
136
- items?: Array<LinkProps>;
137
- }
138
-
139
- interface DataLink {
140
- headline?: string;
141
- items?: Array<LinkProps>;
142
- }
@@ -1,183 +0,0 @@
1
- import { FC } from "react";
2
- import classnames from "classnames";
3
- import useGlobalSettings from "../../hooks/useGlobalSettings";
4
- import { CardProps } from "./Card.props";
5
- import { Link } from "../Link";
6
- import { List, ListItem } from "../List";
7
- import { LinkList } from "../LinkList";
8
- import { Profile } from "../Profile";
9
-
10
- const Card: FC<CardProps> = ({
11
- isvideo,
12
- eyebrow,
13
- title,
14
- color,
15
- theme,
16
- variant,
17
- size,
18
- cornercut,
19
- alignment,
20
- intro,
21
- date,
22
- eventdetails,
23
- profile,
24
- listitems,
25
- link,
26
- linklist,
27
- cta,
28
- image,
29
- source,
30
- dataset,
31
- }) => {
32
- const { prefix } = useGlobalSettings();
33
-
34
- const baseClass = `${prefix}--card`;
35
- const cardClasses = classnames(
36
- baseClass,
37
- `${baseClass}--${variant}`,
38
- `${baseClass}--${color}`,
39
- {
40
- [`${baseClass}--${cornercut}`]: cornercut,
41
- [`${baseClass}--${alignment}`]: alignment,
42
- [`${baseClass}--action`]: link,
43
- [`${baseClass}--${size}`]: size,
44
- [`${baseClass}--isvideo`]: isvideo,
45
- [`${baseClass}--linklist`]: linklist,
46
- [`${baseClass}--${theme}`]: theme,
47
- }
48
- );
49
-
50
- return (
51
- <div className={cardClasses}>
52
- {link &&
53
- variant != "data" &&
54
- variant != "factlist" &&
55
- variant != "stat" && (
56
- <a className={`${baseClass}--link`} href={link} title={title}>
57
- <span className={`${baseClass}--link--text`}>{title}</span>
58
- </a>
59
- )}
60
- <div className={`${baseClass}--wrap`}>
61
- {image && (
62
- <div className={`${baseClass}--image--wrapper`}>
63
- <picture>
64
- <img className={`${baseClass}--image`} src={image} alt={title} />
65
- </picture>
66
- </div>
67
- )}
68
- <div className={`${baseClass}--content`}>
69
- {eyebrow && <p className={`${baseClass}--eyebrow`}>{eyebrow}</p>}
70
- {title && <h3 className={`${baseClass}--title`}>{title}</h3>}
71
- {(variant == "multilink" || (variant == "data" && image)) && (
72
- <div className={`${baseClass}--image--wrapper`}>
73
- <picture>
74
- <img
75
- className={`${baseClass}--image`}
76
- src={image}
77
- alt={title}
78
- />
79
- </picture>
80
- </div>
81
- )}
82
- {intro && <p className={`${baseClass}--intro`}>{intro}</p>}
83
- {date &&
84
- variant != "stat" &&
85
- variant != "data" &&
86
- variant != "graphicpromo" &&
87
- variant != "factlist" && (
88
- <time className={`${baseClass}--date`} dateTime={date.unix}>
89
- {date.human}
90
- </time>
91
- )}
92
- {eventdetails && (
93
- <p className={`${baseClass}--event-date`}>{eventdetails}</p>
94
- )}
95
- {profile && profile.avatar && (
96
- <Profile
97
- avatar={profile.avatar}
98
- description={profile.description}
99
- link={profile.link}
100
- name={profile.name}
101
- role={profile.role}
102
- className={`${prefix}--profile--contents--${theme}`}
103
- />
104
- )}
105
- {listitems && (
106
- <List alignment="default" ordered="unordered">
107
- {listitems.map((item, index) => (
108
- <ListItem id={`list${index}`}>
109
- <p>{item}</p>
110
- </ListItem>
111
- ))}
112
- </List>
113
- )}
114
- {cta && cta.label && (
115
- <a
116
- className={`${baseClass}--cta ${prefix}--button ${prefix}--button--medium ${prefix}--button--primary`}
117
- href={cta.url}
118
- >
119
- <span className="link__label">{cta.label}</span>
120
- </a>
121
- )}
122
- {source && (
123
- <Link theme={theme} url={source.url}>
124
- {source.label}
125
- </Link>
126
- )}
127
- {linklist && (
128
- <LinkList
129
- headline={linklist.headline}
130
- linkgroup={linklist.linkgroup}
131
- />
132
- )}
133
- {dataset &&
134
- dataset.content &&
135
- dataset.content.items &&
136
- dataset.content.items.map((item) => (
137
- <>
138
- <p className={`${baseClass}--data--content-label`}>
139
- {item.label}
140
- </p>
141
- <p className={`${baseClass}--data--content-copy`}>
142
- {item.copy}
143
- </p>
144
- </>
145
- ))}
146
- {dataset && dataset.files && (
147
- <div className={`${baseClass}--data--content-files`}>
148
- <p className={`${baseClass}--data--content-label`}>
149
- {dataset.files.headline}
150
- </p>
151
- {dataset.files.items &&
152
- dataset.files.items.map((item) => (
153
- <a
154
- className={`${baseClass}--data--file ${prefix}--button ${prefix}--button--primary ${prefix}--button--small`}
155
- href={item.url}
156
- download
157
- >
158
- <span className="button__label">{item.label}</span>
159
- </a>
160
- ))}
161
- </div>
162
- )}
163
- {dataset && dataset.links && (
164
- <div className={`${baseClass}--data--content-links`}>
165
- <p className={`${baseClass}--data--content-label`}>
166
- {dataset.links.headline}
167
- </p>
168
- {dataset.links.items &&
169
- dataset.links.items.map((item) => (
170
- <>
171
- <Link url={item.url}>{item.label}</Link>
172
- <span>&nbsp;&nbsp;</span>
173
- </>
174
- ))}
175
- </div>
176
- )}
177
- </div>
178
- </div>
179
- </div>
180
- );
181
- };
182
-
183
- export default Card;
@@ -1,2 +0,0 @@
1
- export { default as Card } from "./Card";
2
- export { default as CardGroup } from "./CardGroup";