@arc-ui/community-components 0.1.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 (198) hide show
  1. package/.turbo/turbo-build.log +16 -0
  2. package/CHANGELOG.md +7 -0
  3. package/LICENSE +21 -0
  4. package/dist/Accordion/Accordion.cjs.js +31 -0
  5. package/dist/Accordion/Accordion.esm.js +29 -0
  6. package/dist/Author/Author.cjs.js +14 -0
  7. package/dist/Author/Author.esm.js +8 -0
  8. package/dist/Author/styles.css +1 -0
  9. package/dist/BannerWithTabs/BannerWithTabs.cjs.js +36 -0
  10. package/dist/BannerWithTabs/BannerWithTabs.esm.js +34 -0
  11. package/dist/BannerWithTabs/styles.css +1 -0
  12. package/dist/CopyLead/CopyLead.cjs.js +129 -0
  13. package/dist/CopyLead/CopyLead.esm.js +127 -0
  14. package/dist/CopyLead/styles.css +1 -0
  15. package/dist/DownloadList/DownloadList.cjs.js +26 -0
  16. package/dist/DownloadList/DownloadList.esm.js +24 -0
  17. package/dist/DownloadList/styles.css +1 -0
  18. package/dist/FeaturePost/FeaturePost.cjs.js +2281 -0
  19. package/dist/FeaturePost/FeaturePost.esm.js +2279 -0
  20. package/dist/FeaturePost/styles.css +1 -0
  21. package/dist/Highlights/Highlights.cjs.js +50 -0
  22. package/dist/Highlights/Highlights.esm.js +48 -0
  23. package/dist/Highlights/styles.css +1 -0
  24. package/dist/PromoListing/PromoListing.cjs.js +50 -0
  25. package/dist/PromoListing/PromoListing.esm.js +48 -0
  26. package/dist/PromoListing/styles.css +1 -0
  27. package/dist/Quote/Quote.cjs.js +27 -0
  28. package/dist/Quote/Quote.esm.js +25 -0
  29. package/dist/Quote/styles.css +1 -0
  30. package/dist/SectionHeading/SectionHeading.cjs.js +14 -0
  31. package/dist/SectionHeading/SectionHeading.esm.js +8 -0
  32. package/dist/SectionHeading/styles.css +1 -0
  33. package/dist/Statistics/Statistics.cjs.js +60 -0
  34. package/dist/Statistics/Statistics.esm.js +58 -0
  35. package/dist/Statistics/styles.css +1 -0
  36. package/dist/Summary/Summary.cjs.js +30 -0
  37. package/dist/Summary/Summary.esm.js +28 -0
  38. package/dist/Summary/styles.css +1 -0
  39. package/dist/_shared/cjs/Author-CAo-qryZ.js +30 -0
  40. package/dist/_shared/cjs/SectionHeading-L2EpTQ79.js +25 -0
  41. package/dist/_shared/cjs/filter-data-attrs-ajtUvDAC.js +15 -0
  42. package/dist/_shared/cjs/index-Bp6Dd2i1.js +94 -0
  43. package/dist/_shared/cjs/index.es-X428Cm3N.js +15 -0
  44. package/dist/_shared/cjs/tslib.es6-DBA0GFPJ.js +48 -0
  45. package/dist/_shared/esm/Author-Bx-cE9Pz.js +28 -0
  46. package/dist/_shared/esm/SectionHeading-C70XNhqJ.js +23 -0
  47. package/dist/_shared/esm/filter-data-attrs-V7cbJuwS.js +13 -0
  48. package/dist/_shared/esm/index-BfTCfPZ1.js +92 -0
  49. package/dist/_shared/esm/index.es-BzmvPxje.js +10 -0
  50. package/dist/_shared/esm/tslib.es6-Cv15O4Nx.js +46 -0
  51. package/dist/index.es.js +2796 -0
  52. package/dist/index.es.js.map +1 -0
  53. package/dist/index.js +2808 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/styles.css +1 -0
  56. package/dist/types/components/Accordion/Accordion.d.ts +9 -0
  57. package/dist/types/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.d.ts +9 -0
  58. package/dist/types/components/Accordion/index.d.ts +1 -0
  59. package/dist/types/components/Author/Author.d.ts +17 -0
  60. package/dist/types/components/Author/index.d.ts +1 -0
  61. package/dist/types/components/BannerWithTabs/BannerWithTabs.d.ts +17 -0
  62. package/dist/types/components/BannerWithTabs/index.d.ts +1 -0
  63. package/dist/types/components/CopyLead/CopyLead.d.ts +42 -0
  64. package/dist/types/components/CopyLead/components/Button/Button.d.ts +3 -0
  65. package/dist/types/components/CopyLead/components/Button/index.d.ts +1 -0
  66. package/dist/types/components/CopyLead/components/Column/Column.d.ts +6 -0
  67. package/dist/types/components/CopyLead/components/Column/index.d.ts +1 -0
  68. package/dist/types/components/CopyLead/components/Container/Container.d.ts +9 -0
  69. package/dist/types/components/CopyLead/components/Container/index.d.ts +1 -0
  70. package/dist/types/components/CopyLead/components/IconList/IconList.d.ts +8 -0
  71. package/dist/types/components/CopyLead/components/IconList/index.d.ts +1 -0
  72. package/dist/types/components/CopyLead/components/Image/Image.d.ts +3 -0
  73. package/dist/types/components/CopyLead/components/Image/index.d.ts +1 -0
  74. package/dist/types/components/CopyLead/components/MediaContent/MediaContent.d.ts +9 -0
  75. package/dist/types/components/CopyLead/components/MediaContent/index.d.ts +1 -0
  76. package/dist/types/components/CopyLead/index.d.ts +1 -0
  77. package/dist/types/components/CopyLead/templates/Content/Content.d.ts +10 -0
  78. package/dist/types/components/CopyLead/templates/Content/index.d.ts +1 -0
  79. package/dist/types/components/CopyLead/templates/Media/Media.d.ts +16 -0
  80. package/dist/types/components/CopyLead/templates/Media/index.d.ts +1 -0
  81. package/dist/types/components/CopyLead/types/copy-lead-button.d.ts +2 -0
  82. package/dist/types/components/CopyLead/types/copy-lead-image.d.ts +4 -0
  83. package/dist/types/components/CopyLead/types/copy-lead-list-item.d.ts +6 -0
  84. package/dist/types/components/CopyLead/types/copy-lead-transcript-link.d.ts +6 -0
  85. package/dist/types/components/CopyLead/types/index.d.ts +4 -0
  86. package/dist/types/components/DownloadList/DownloadList.d.ts +10 -0
  87. package/dist/types/components/DownloadList/index.d.ts +1 -0
  88. package/dist/types/components/FeaturePost/FeaturePost.d.ts +45 -0
  89. package/dist/types/components/FeaturePost/components/Image/Image.d.ts +3 -0
  90. package/dist/types/components/FeaturePost/components/Image/index.d.ts +1 -0
  91. package/dist/types/components/FeaturePost/components/MediaContent/MediaContent.d.ts +15 -0
  92. package/dist/types/components/FeaturePost/index.d.ts +1 -0
  93. package/dist/types/components/FeaturePost/types/feature-post-app-button-footer.d.ts +6 -0
  94. package/dist/types/components/FeaturePost/types/feature-post-cta-footer.d.ts +7 -0
  95. package/dist/types/components/FeaturePost/types/feature-post-image.d.ts +4 -0
  96. package/dist/types/components/FeaturePost/types/index.d.ts +3 -0
  97. package/dist/types/components/Highlights/Highlights.d.ts +17 -0
  98. package/dist/types/components/Highlights/components/HighlightItem/HighlightItem.d.ts +14 -0
  99. package/dist/types/components/Highlights/components/HighlightList/HighlightList.d.ts +9 -0
  100. package/dist/types/components/Highlights/index.d.ts +1 -0
  101. package/dist/types/components/Highlights/types/highlight-list-item.d.ts +10 -0
  102. package/dist/types/components/Highlights/types/index.d.ts +1 -0
  103. package/dist/types/components/PromoListing/PromoListing.d.ts +38 -0
  104. package/dist/types/components/PromoListing/index.d.ts +1 -0
  105. package/dist/types/components/Quote/Quote.d.ts +11 -0
  106. package/dist/types/components/Quote/index.d.ts +1 -0
  107. package/dist/types/components/SectionHeading/SectionHeading.d.ts +25 -0
  108. package/dist/types/components/SectionHeading/index.d.ts +1 -0
  109. package/dist/types/components/Statistics/Statistics.d.ts +7 -0
  110. package/dist/types/components/Statistics/helpers/get-link-props.d.ts +2 -0
  111. package/dist/types/components/Statistics/index.d.ts +1 -0
  112. package/dist/types/components/Statistics/types/statistic-link.d.ts +6 -0
  113. package/dist/types/components/Statistics/types/statistic.d.ts +8 -0
  114. package/dist/types/components/Summary/Summary.d.ts +18 -0
  115. package/dist/types/components/Summary/index.d.ts +1 -0
  116. package/dist/types/components/index.d.ts +11 -0
  117. package/dist/types/index.d.ts +1 -0
  118. package/eslint.config.js +4 -0
  119. package/package.json +105 -0
  120. package/postcss.config.cjs +5 -0
  121. package/rollup.config.js +101 -0
  122. package/src/components/Accordion/Accordion.tsx +38 -0
  123. package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +44 -0
  124. package/src/components/Accordion/index.ts +1 -0
  125. package/src/components/Author/Author.module.css +9 -0
  126. package/src/components/Author/Author.tsx +60 -0
  127. package/src/components/Author/index.ts +1 -0
  128. package/src/components/BannerWithTabs/BannerWithTabs.module.css +19 -0
  129. package/src/components/BannerWithTabs/BannerWithTabs.tsx +74 -0
  130. package/src/components/BannerWithTabs/index.ts +1 -0
  131. package/src/components/CopyLead/CopyLead.module.css +127 -0
  132. package/src/components/CopyLead/CopyLead.tsx +102 -0
  133. package/src/components/CopyLead/components/Button/Button.tsx +13 -0
  134. package/src/components/CopyLead/components/Button/index.ts +1 -0
  135. package/src/components/CopyLead/components/Column/Column.tsx +10 -0
  136. package/src/components/CopyLead/components/Column/index.ts +1 -0
  137. package/src/components/CopyLead/components/Container/Container.tsx +32 -0
  138. package/src/components/CopyLead/components/Container/index.ts +1 -0
  139. package/src/components/CopyLead/components/IconList/IconList.tsx +49 -0
  140. package/src/components/CopyLead/components/IconList/index.ts +1 -0
  141. package/src/components/CopyLead/components/Image/Image.tsx +17 -0
  142. package/src/components/CopyLead/components/Image/index.ts +1 -0
  143. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +36 -0
  144. package/src/components/CopyLead/components/MediaContent/index.ts +1 -0
  145. package/src/components/CopyLead/index.ts +1 -0
  146. package/src/components/CopyLead/templates/Content/Content.tsx +58 -0
  147. package/src/components/CopyLead/templates/Content/index.ts +1 -0
  148. package/src/components/CopyLead/templates/Media/Media.tsx +104 -0
  149. package/src/components/CopyLead/templates/Media/index.ts +1 -0
  150. package/src/components/CopyLead/types/copy-lead-button.ts +6 -0
  151. package/src/components/CopyLead/types/copy-lead-image.ts +19 -0
  152. package/src/components/CopyLead/types/copy-lead-list-item.ts +7 -0
  153. package/src/components/CopyLead/types/copy-lead-transcript-link.ts +6 -0
  154. package/src/components/CopyLead/types/index.ts +4 -0
  155. package/src/components/DownloadList/DownloadList.module.css +7 -0
  156. package/src/components/DownloadList/DownloadList.tsx +41 -0
  157. package/src/components/DownloadList/index.ts +1 -0
  158. package/src/components/FeaturePost/FeaturePost.module.css +58 -0
  159. package/src/components/FeaturePost/FeaturePost.tsx +203 -0
  160. package/src/components/FeaturePost/components/Image/Image.tsx +18 -0
  161. package/src/components/FeaturePost/components/Image/index.ts +1 -0
  162. package/src/components/FeaturePost/components/MediaContent/MediaContent.tsx +45 -0
  163. package/src/components/FeaturePost/components/MediaContent/index.ts +0 -0
  164. package/src/components/FeaturePost/index.ts +1 -0
  165. package/src/components/FeaturePost/types/feature-post-app-button-footer.ts +7 -0
  166. package/src/components/FeaturePost/types/feature-post-cta-footer.ts +11 -0
  167. package/src/components/FeaturePost/types/feature-post-image.ts +19 -0
  168. package/src/components/FeaturePost/types/index.ts +3 -0
  169. package/src/components/Highlights/Highlights.module.css +85 -0
  170. package/src/components/Highlights/Highlights.tsx +53 -0
  171. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +68 -0
  172. package/src/components/Highlights/components/HighlightList/HighlightList.tsx +42 -0
  173. package/src/components/Highlights/index.ts +1 -0
  174. package/src/components/Highlights/types/highlight-list-item.ts +11 -0
  175. package/src/components/Highlights/types/index.ts +1 -0
  176. package/src/components/PromoListing/PromoListing.module.css +97 -0
  177. package/src/components/PromoListing/PromoListing.tsx +153 -0
  178. package/src/components/PromoListing/index.ts +1 -0
  179. package/src/components/Quote/Quote.module.css +60 -0
  180. package/src/components/Quote/Quote.tsx +57 -0
  181. package/src/components/Quote/index.ts +1 -0
  182. package/src/components/SectionHeading/SectionHeading.module.css +34 -0
  183. package/src/components/SectionHeading/SectionHeading.tsx +65 -0
  184. package/src/components/SectionHeading/index.ts +1 -0
  185. package/src/components/Statistics/Statistics.module.css +25 -0
  186. package/src/components/Statistics/Statistics.tsx +97 -0
  187. package/src/components/Statistics/helpers/get-link-props.ts +11 -0
  188. package/src/components/Statistics/index.ts +1 -0
  189. package/src/components/Statistics/types/statistic-link.ts +6 -0
  190. package/src/components/Statistics/types/statistic.ts +9 -0
  191. package/src/components/Summary/Summary.module.css +31 -0
  192. package/src/components/Summary/Summary.tsx +65 -0
  193. package/src/components/Summary/index.ts +1 -0
  194. package/src/components/index.ts +11 -0
  195. package/src/index.ts +5 -0
  196. package/src/types/file-types.d.ts +9 -0
  197. package/stylelint.config.js +4 -0
  198. package/tsconfig.json +11 -0
@@ -0,0 +1,203 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import { isDate, format } from "date-fns";
4
+
5
+ import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
6
+
7
+ import { ArcSizeBreakpointsM } from "@arc-ui/tokens-arc";
8
+
9
+ import { AppButton } from "@arc-ui/components/dist/AppButton";
10
+ import { Grid } from "@arc-ui/components/dist/Grid";
11
+ import { ButtonV2 } from "@arc-ui/components/dist/ButtonV2";
12
+ import { Heading, type HeadingLevel } from "@arc-ui/components/dist/Heading";
13
+ import { Text } from "@arc-ui/components/dist/Text";
14
+ import { VerticalSpace } from "@arc-ui/components/dist/VerticalSpace";
15
+ import { useMediaQuery } from "@arc-ui/components/dist/use-media-query";
16
+ import { type VideoPlayerProps } from "@arc-ui/components/dist/VideoPlayer";
17
+
18
+ import { Author } from "../Author";
19
+
20
+ import {
21
+ type FeaturePostAppButtonFooter,
22
+ type FeaturePostCtaFooter,
23
+ type FeaturePostImage,
24
+ } from "./types";
25
+
26
+ import styles from "./FeaturePost.module.css";
27
+ import { MediaContent } from "./components/MediaContent/MediaContent";
28
+
29
+ /**
30
+ * Use `FeaturePost` to direct traffic towards an article, case study, or product information page, or to a 3rd part App Store provider. Where the component links to an article page, the author attribution can be given here. The `FeaturePost` must be supported by an image, and in future, the component will support embedded video as well.
31
+ * */
32
+ export const FeaturePost: React.FC<FeaturePostProps> = ({
33
+ heading,
34
+ headingLevel = "2",
35
+ label,
36
+ image,
37
+ content,
38
+ footer,
39
+ video,
40
+ isReverseOrder = false,
41
+ ...props
42
+ }) => {
43
+ const isMinWidthArcBreakpointM = useMediaQuery(
44
+ `(min-width: ${ArcSizeBreakpointsM})`,
45
+ );
46
+
47
+ return (
48
+ <div
49
+ data-testid="feature-post"
50
+ className={classNames(styles.featurePost, {
51
+ [styles.featurePostReversed]: isReverseOrder,
52
+ })}
53
+ {...filterDataAttrs(props)}
54
+ >
55
+ <div className={styles.col}>
56
+ <div className={styles.contentContainer}>
57
+ {label && (
58
+ <Grid isGutterless isFluid>
59
+ <Grid.Row align="baseline">
60
+ <Grid.Col xs={12} m="auto">
61
+ <Heading size="xxs">{label.text.toUpperCase()}</Heading>
62
+ </Grid.Col>
63
+ <Grid.Col xs={12} m="auto">
64
+ <div className={styles.labelDate}>
65
+ <Text size="xs" tone="muted">
66
+ {isDate(label.date) ? (
67
+ <time
68
+ dateTime={format(label.date as Date, "yyyy-MM-dd")}
69
+ >
70
+ {format(label.date as Date, "LLLL d, yyyy")}
71
+ </time>
72
+ ) : (
73
+ <span>{label.date as string}</span>
74
+ )}
75
+ </Text>
76
+ </div>
77
+ </Grid.Col>
78
+ </Grid.Row>
79
+ <VerticalSpace size="24" />
80
+ </Grid>
81
+ )}
82
+
83
+ <Heading level={headingLevel} size="xl">
84
+ {heading}
85
+ </Heading>
86
+
87
+ {!isMinWidthArcBreakpointM && (
88
+ <div data-testid="mobile-img">
89
+ <VerticalSpace size="40" />
90
+
91
+ <MediaContent image={image} video={video} />
92
+ </div>
93
+ )}
94
+
95
+ <VerticalSpace size="40" />
96
+
97
+ <Text size="l">{content}</Text>
98
+
99
+ {footer?.type === "cta" && (
100
+ <>
101
+ {footer.author && (
102
+ <>
103
+ <VerticalSpace size="24" />
104
+ <Author
105
+ name={footer.author.name}
106
+ title={footer.author.title!}
107
+ avatar={footer.author.avatar}
108
+ />
109
+ </>
110
+ )}
111
+ <VerticalSpace size="40" />
112
+
113
+ <ButtonV2 buttonStyle="secondary" {...footer.button} />
114
+ </>
115
+ )}
116
+
117
+ {footer?.type === "appButton" && (
118
+ <>
119
+ <VerticalSpace size="40" />
120
+ <Grid isGutterless isFluid>
121
+ <Grid.Row>
122
+ {footer.appStore && (
123
+ <Grid.Col xs={12} s="auto">
124
+ <AppButton
125
+ type="apple-app-store"
126
+ screenReaderText={footer.appStore.screenReaderText}
127
+ url={footer.appStore.url}
128
+ />
129
+ </Grid.Col>
130
+ )}
131
+ {footer.googlePlay && (
132
+ <Grid.Col xs={12} s="auto">
133
+ <div className={styles.googlePlayButtonWrapper}>
134
+ <AppButton
135
+ type="google-play"
136
+ screenReaderText={footer.googlePlay.screenReaderText}
137
+ url={footer.googlePlay.url}
138
+ />
139
+ </div>
140
+ </Grid.Col>
141
+ )}
142
+ </Grid.Row>
143
+ </Grid>
144
+ </>
145
+ )}
146
+ </div>
147
+ </div>
148
+
149
+ {isMinWidthArcBreakpointM && (
150
+ <div className={styles.col}>
151
+ <div data-testid="desktop-img" className={styles.imgContainer}>
152
+ <MediaContent image={image} video={video} />
153
+ </div>
154
+ </div>
155
+ )}
156
+ </div>
157
+ );
158
+ };
159
+
160
+ export interface FeaturePostProps {
161
+ /**
162
+ * heading for `FeaturePost`.
163
+ */
164
+ heading: string;
165
+
166
+ /**
167
+ * Determine a heading level for `<FeaturePost />`
168
+ */
169
+ headingLevel?: HeadingLevel;
170
+
171
+ /**
172
+ * Text content for `FeaturePost`.
173
+ */
174
+ content: string;
175
+
176
+ /**
177
+ * Reverse the columns so the image / video appears on the left. Doesn't affect mobile layouts, and is only applied if there is a video or an image.
178
+ */
179
+ isReverseOrder?: boolean;
180
+
181
+ /**
182
+ * Image for `FeaturePost`.
183
+ */
184
+ image?: FeaturePostImage;
185
+
186
+ /**
187
+ * Footer for `FeaturePost`. Types included are `cta` or `appButton`.
188
+ */
189
+ footer?: FeaturePostCtaFooter | FeaturePostAppButtonFooter;
190
+
191
+ /**
192
+ * Label for `FeaturePost`.
193
+ */
194
+ label?: {
195
+ text: string;
196
+ date: string | Date;
197
+ };
198
+
199
+ /**
200
+ * Video embed. Supported platforms are YouTube and Vimeo.
201
+ */
202
+ video?: VideoPlayerProps;
203
+ }
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+
3
+ import { Image as ArcImage } from "@arc-ui/components/dist/Image";
4
+
5
+ import { FeaturePostImage } from "../../types";
6
+
7
+ import styles from "../../FeaturePost.module.css";
8
+
9
+ export const Image: React.FC<FeaturePostImage> = ({ sources, ...props }) => (
10
+ <div className={styles.imgWrapper}>
11
+ <ArcImage fadeOnLoad {...props}>
12
+ {sources &&
13
+ sources.map((source) => (
14
+ <ArcImage.Source key={source.srcSet} {...source} />
15
+ ))}
16
+ </ArcImage>
17
+ </div>
18
+ );
@@ -0,0 +1 @@
1
+ export { Image } from "./Image";
@@ -0,0 +1,45 @@
1
+ import React, { Suspense, useEffect, useState } from "react";
2
+
3
+ import { type VideoPlayerProps } from "@arc-ui/components/dist/VideoPlayer";
4
+
5
+ import { type FeaturePostImage } from "../../types";
6
+
7
+ import { Image } from "../Image";
8
+
9
+ const VideoPlayer = React.lazy(() =>
10
+ import("@arc-ui/components/dist/VideoPlayer").then(({ VideoPlayer }) => ({
11
+ default: VideoPlayer,
12
+ })),
13
+ );
14
+
15
+ export const MediaContent: React.FC<MediaContentProps> = ({ image, video }) => {
16
+ const [isClient, setIsClient] = useState(false);
17
+
18
+ useEffect(() => {
19
+ setIsClient(true);
20
+ }, []);
21
+
22
+ return (
23
+ <>
24
+ {image && !video && <Image {...image} />}
25
+
26
+ {video && isClient && (
27
+ <Suspense fallback={null}>
28
+ <VideoPlayer {...video} />
29
+ </Suspense>
30
+ )}
31
+ </>
32
+ );
33
+ };
34
+
35
+ interface MediaContentProps {
36
+ /**
37
+ * Image for `FeaturePost`.
38
+ */
39
+ image?: FeaturePostImage;
40
+
41
+ /**
42
+ * Video embed. Supported platforms are YouTube and Vimeo.
43
+ */
44
+ video?: VideoPlayerProps;
45
+ }
@@ -0,0 +1 @@
1
+ export { FeaturePost, type FeaturePostProps } from "./FeaturePost";
@@ -0,0 +1,7 @@
1
+ import { type AppButtonProps } from "@arc-ui/components/dist/types/components/AppButton";
2
+
3
+ export interface FeaturePostAppButtonFooter {
4
+ type: "appButton";
5
+ googlePlay?: Omit<AppButtonProps, "type">;
6
+ appStore?: Omit<AppButtonProps, "type">;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { type ButtonProps } from "@arc-ui/components/dist/types/components/Button/Button";
2
+ import { type AuthorProps } from "../../Author/Author";
3
+
4
+ export interface FeaturePostCtaFooter {
5
+ type: "cta";
6
+ button: Pick<
7
+ ButtonProps,
8
+ "label" | "onClick" | "href" | "target" | "ariaLabel"
9
+ >;
10
+ author?: AuthorProps;
11
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ type ImageSourceProps,
3
+ type ImageProps as ArcImageProps,
4
+ } from "@arc-ui/components/dist/types/components/Image/Image";
5
+
6
+ export interface FeaturePostImage
7
+ extends Pick<
8
+ ArcImageProps,
9
+ | "src"
10
+ | "alt"
11
+ | "loading"
12
+ | "sizes"
13
+ | "srcSet"
14
+ | "width"
15
+ | "height"
16
+ | "fadeOnLoad"
17
+ > {
18
+ sources?: Pick<ImageSourceProps, "media" | "sizes" | "srcSet">[];
19
+ }
@@ -0,0 +1,3 @@
1
+ export { type FeaturePostAppButtonFooter } from "./feature-post-app-button-footer";
2
+ export { type FeaturePostCtaFooter } from "./feature-post-cta-footer";
3
+ export { type FeaturePostImage } from "./feature-post-image";
@@ -0,0 +1,85 @@
1
+ @import url("@arc-ui/tokens-arc/dist/custom-media.css");
2
+
3
+ .highlights {
4
+ display: grid;
5
+ gap: 48px 24px;
6
+ grid-template-columns: 1fr;
7
+ }
8
+
9
+ .highlightItem {
10
+ max-width: 480px;
11
+ width: auto;
12
+ }
13
+
14
+ @media (--arc-custom-media-min-width-s-px) {
15
+ .highlights {
16
+ grid-template-columns: 1fr 1fr;
17
+ }
18
+
19
+ .highlightItem {
20
+ min-width: 282px;
21
+ padding-right: 0;
22
+ }
23
+ }
24
+
25
+ @media (--arc-custom-media-min-width-m-px) {
26
+ .highlights2Column {
27
+ grid-template-columns: 1fr 1fr;
28
+ }
29
+
30
+ .highlights2Column .highlightItem {
31
+ max-width: max-content;
32
+ min-width: 348px;
33
+ padding-right: 62px;
34
+ }
35
+
36
+ .highlights3Column {
37
+ grid-template-columns: 1fr 1fr 1fr;
38
+ }
39
+
40
+ .highlights3Column .highlightItem {
41
+ min-width: 224px;
42
+ }
43
+ }
44
+
45
+ @media (--arc-custom-media-min-width-l-px) {
46
+ .highlights2Column {
47
+ grid-template-columns: 1fr 1fr;
48
+ }
49
+
50
+ .highlights2Column .highlightItem {
51
+ min-width: 468px;
52
+ padding-right: 82px;
53
+ }
54
+
55
+ .highlights3Column {
56
+ grid-template-columns: 1fr 1fr 1fr;
57
+ }
58
+
59
+ .highlights3Column .highlightItem {
60
+ min-width: 304px;
61
+ }
62
+ }
63
+
64
+ @media (--arc-custom-media-min-width-xl-px) {
65
+ .highlights {
66
+ gap: 48px 32px;
67
+ }
68
+
69
+ .highlights2Column {
70
+ grid-template-columns: 1fr 1fr;
71
+ }
72
+
73
+ .highlights2Column .highlightItem {
74
+ min-width: 592px;
75
+ padding-right: 104px;
76
+ }
77
+
78
+ .highlights3Column {
79
+ grid-template-columns: 1fr 1fr 1fr;
80
+ }
81
+
82
+ .highlights3Column .highlightItem {
83
+ min-width: 384px;
84
+ }
85
+ }
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+
3
+ import { useMediaQuery } from "@arc-ui/components/dist/use-media-query";
4
+
5
+ import { SectionHeading, type SectionHeadingProps } from "../SectionHeading";
6
+
7
+ import { HighlightList } from "./components/HighlightList/HighlightList";
8
+
9
+ import { type HighlightListItem } from "./types";
10
+
11
+ /**
12
+ * Use `Highlights` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link. Both two and three column options are available.
13
+ */
14
+ export const Highlights: React.FC<HighlightsProps> = ({
15
+ heading,
16
+ headingLevel,
17
+ content,
18
+ listItems,
19
+ columns = "2",
20
+ }) => {
21
+ const isMaxWidthArcBreakpointXs = useMediaQuery(`(max-width: 767px)`);
22
+
23
+ return (
24
+ <div>
25
+ <SectionHeading
26
+ isPadded
27
+ data-testid="highlights-header"
28
+ heading={heading}
29
+ headingLevel={headingLevel}
30
+ content={content}
31
+ />
32
+
33
+ <HighlightList
34
+ data-testid="highlights-list-container"
35
+ listItems={listItems}
36
+ columns={columns}
37
+ isSmallIcon={isMaxWidthArcBreakpointXs}
38
+ />
39
+ </div>
40
+ );
41
+ };
42
+
43
+ export interface HighlightsProps extends SectionHeadingProps {
44
+ /**
45
+ * List items for `Highlights`. List length should be a minimum of 2 and a maximum of 6.
46
+ */
47
+ listItems: HighlightListItem[];
48
+
49
+ /**
50
+ * Number of columns for option desktop and tablet breakpoints only.
51
+ */
52
+ columns?: "2" | "3";
53
+ }
@@ -0,0 +1,68 @@
1
+ import React from "react";
2
+ import { type ArcIcon } from "@arc-ui/components/dist/types/types/arc-icon";
3
+
4
+ import { Heading } from "@arc-ui/components/dist/Heading";
5
+ import { Icon } from "@arc-ui/components/dist/Icon";
6
+ import { Text } from "@arc-ui/components/dist/Text";
7
+ import { Link } from "@arc-ui/components/dist/Link";
8
+ import { VerticalSpace } from "@arc-ui/components/dist/VerticalSpace";
9
+
10
+ import styles from "../../Highlights.module.css";
11
+
12
+ export const HighlightItem: React.FC<HighlightItemProps> = ({
13
+ icon,
14
+ heading,
15
+ text,
16
+ link,
17
+ isSmallIcon,
18
+ }) => {
19
+ return (
20
+ <div
21
+ data-testid="highlight-item-container"
22
+ className={styles.highlightItem}
23
+ >
24
+ {icon && (
25
+ <div className={styles.Icon}>
26
+ <Icon
27
+ data-testid="highlight-icon"
28
+ color="brand"
29
+ icon={icon}
30
+ size={isSmallIcon ? 64 : 76}
31
+ />
32
+ </div>
33
+ )}
34
+ <VerticalSpace size="16" />
35
+ <Heading level="3" size="m">
36
+ {heading}
37
+ </Heading>
38
+ <VerticalSpace size="16" />
39
+ <Text>{text}</Text>
40
+ <VerticalSpace size="16" />
41
+
42
+ {link && (
43
+ <Link
44
+ href={link.url}
45
+ id={link.url}
46
+ onClick={function noRefCheck() {}}
47
+ rel=""
48
+ size="m"
49
+ target="_self"
50
+ title={link.textLink}
51
+ >
52
+ {link.textLink}
53
+ </Link>
54
+ )}
55
+ </div>
56
+ );
57
+ };
58
+
59
+ interface HighlightItemProps {
60
+ icon?: ArcIcon;
61
+ heading: string;
62
+ text?: string;
63
+ link?: {
64
+ url: string;
65
+ textLink: string;
66
+ };
67
+ isSmallIcon: boolean;
68
+ }
@@ -0,0 +1,42 @@
1
+ import React, { useId } from "react";
2
+ import classNames from "classnames";
3
+
4
+ import { type HighlightListItem } from "../../types/highlight-list-item";
5
+ import { HighlightItem } from "../HighlightItem/HighlightItem";
6
+
7
+ import styles from "../../Highlights.module.css";
8
+
9
+ export const HighlightList: React.FC<HighlightListProps> = ({
10
+ listItems,
11
+ columns,
12
+ isSmallIcon,
13
+ }) => {
14
+ const id = useId();
15
+
16
+ return (
17
+ <div
18
+ data-testid="highlights-list"
19
+ className={classNames(
20
+ styles.highlights,
21
+ styles[`highlights${columns}Column`],
22
+ )}
23
+ >
24
+ {listItems.map(({ icon, heading, text, link }, i) => (
25
+ <HighlightItem
26
+ key={`highlight-${id}-${i}`}
27
+ icon={icon}
28
+ heading={heading}
29
+ text={text}
30
+ link={link}
31
+ isSmallIcon={isSmallIcon}
32
+ />
33
+ ))}
34
+ </div>
35
+ );
36
+ };
37
+
38
+ interface HighlightListProps {
39
+ listItems: HighlightListItem[];
40
+ columns: "2" | "3";
41
+ isSmallIcon: boolean;
42
+ }
@@ -0,0 +1 @@
1
+ export { Highlights, type HighlightsProps } from "./Highlights";
@@ -0,0 +1,11 @@
1
+ import { type ArcIcon } from "@arc-ui/components/dist/types/types/arc-icon";
2
+
3
+ export interface HighlightListItem {
4
+ icon?: ArcIcon;
5
+ heading: string;
6
+ text?: string;
7
+ link?: {
8
+ url: string;
9
+ textLink: string;
10
+ };
11
+ }
@@ -0,0 +1 @@
1
+ export { type HighlightListItem } from "./highlight-list-item";
@@ -0,0 +1,97 @@
1
+ @import url("@arc-ui/tokens-arc/dist/custom-media.css");
2
+
3
+ .PromoListing {
4
+ max-width: 1280px;
5
+ }
6
+
7
+ .promoListingContainer {
8
+ grid-column: span 2;
9
+ height: 100%;
10
+ width: 100%;
11
+ }
12
+
13
+ .cardGrid {
14
+ display: grid;
15
+ gap: 24px;
16
+ grid-template-columns: 2fr;
17
+ }
18
+
19
+ .carouselSlide {
20
+ height: 100%;
21
+ padding: 6px;
22
+ }
23
+
24
+ @media (--arc-custom-media-min-width-xs-px) {
25
+ .cardGrid {
26
+ grid-auto-rows: minmax(430px, 1fr);
27
+ }
28
+ }
29
+
30
+ @media (--arc-custom-media-min-width-s-px) {
31
+ .cardGrid2Columns {
32
+ grid-auto-rows: minmax(430px, 1fr);
33
+ grid-template-columns: repeat(4, 1fr);
34
+ }
35
+
36
+ /* Dealing with single orphan */
37
+ .cardGrid2Columns.cardGrid3Cards .promoListingContainer:last-child {
38
+ grid-column-end: 4;
39
+ }
40
+
41
+ .cardGrid2Columns.cardGrid5Cards .promoListingContainer:last-child {
42
+ grid-column-end: 4;
43
+ }
44
+ }
45
+
46
+ @media (--arc-custom-media-min-width-m-px) {
47
+ .cardGrid2Columns {
48
+ grid-auto-rows: minmax(430px, 1fr);
49
+ }
50
+ }
51
+
52
+ @media (--arc-custom-media-min-width-l-px) {
53
+ .cardGrid2Columns {
54
+ grid-auto-rows: minmax(468px, 1fr);
55
+ }
56
+
57
+ .cardGrid3Columns {
58
+ grid-auto-rows: minmax(437px, 1fr);
59
+ grid-template-columns: repeat(6, 1fr);
60
+ }
61
+
62
+ /* Dealing with single orphan */
63
+ .cardGrid3Columns.cardGrid4Cards .promoListingContainer:last-child {
64
+ grid-column-end: 5;
65
+ }
66
+
67
+ /* Dealing with two orphans */
68
+ .cardGrid3Columns.cardGrid2Cards .promoListingContainer:last-child {
69
+ grid-column-end: 6;
70
+ }
71
+
72
+ .cardGrid3Columns.cardGrid5Cards .promoListingContainer:last-child {
73
+ grid-column-end: 6;
74
+ }
75
+
76
+ .cardGrid3Columns.cardGrid2Cards .promoListingContainer:nth-last-child(2) {
77
+ grid-column-end: 4;
78
+ }
79
+
80
+ .cardGrid3Columns.cardGrid5Cards .promoListingContainer:nth-last-child(2) {
81
+ grid-column-end: 4;
82
+ }
83
+ }
84
+
85
+ @media (--arc-custom-media-min-width-xl-px) {
86
+ .cardGrid2Columns {
87
+ grid-auto-rows: minmax(592px, 1fr);
88
+ }
89
+
90
+ .cardGrid3Columns {
91
+ grid-auto-rows: minmax(523px, 1fr);
92
+ }
93
+
94
+ .cardGrid {
95
+ gap: 32px;
96
+ }
97
+ }