@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.
- package/.turbo/turbo-build.log +16 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/dist/Accordion/Accordion.cjs.js +31 -0
- package/dist/Accordion/Accordion.esm.js +29 -0
- package/dist/Author/Author.cjs.js +14 -0
- package/dist/Author/Author.esm.js +8 -0
- package/dist/Author/styles.css +1 -0
- package/dist/BannerWithTabs/BannerWithTabs.cjs.js +36 -0
- package/dist/BannerWithTabs/BannerWithTabs.esm.js +34 -0
- package/dist/BannerWithTabs/styles.css +1 -0
- package/dist/CopyLead/CopyLead.cjs.js +129 -0
- package/dist/CopyLead/CopyLead.esm.js +127 -0
- package/dist/CopyLead/styles.css +1 -0
- package/dist/DownloadList/DownloadList.cjs.js +26 -0
- package/dist/DownloadList/DownloadList.esm.js +24 -0
- package/dist/DownloadList/styles.css +1 -0
- package/dist/FeaturePost/FeaturePost.cjs.js +2281 -0
- package/dist/FeaturePost/FeaturePost.esm.js +2279 -0
- package/dist/FeaturePost/styles.css +1 -0
- package/dist/Highlights/Highlights.cjs.js +50 -0
- package/dist/Highlights/Highlights.esm.js +48 -0
- package/dist/Highlights/styles.css +1 -0
- package/dist/PromoListing/PromoListing.cjs.js +50 -0
- package/dist/PromoListing/PromoListing.esm.js +48 -0
- package/dist/PromoListing/styles.css +1 -0
- package/dist/Quote/Quote.cjs.js +27 -0
- package/dist/Quote/Quote.esm.js +25 -0
- package/dist/Quote/styles.css +1 -0
- package/dist/SectionHeading/SectionHeading.cjs.js +14 -0
- package/dist/SectionHeading/SectionHeading.esm.js +8 -0
- package/dist/SectionHeading/styles.css +1 -0
- package/dist/Statistics/Statistics.cjs.js +60 -0
- package/dist/Statistics/Statistics.esm.js +58 -0
- package/dist/Statistics/styles.css +1 -0
- package/dist/Summary/Summary.cjs.js +30 -0
- package/dist/Summary/Summary.esm.js +28 -0
- package/dist/Summary/styles.css +1 -0
- package/dist/_shared/cjs/Author-CAo-qryZ.js +30 -0
- package/dist/_shared/cjs/SectionHeading-L2EpTQ79.js +25 -0
- package/dist/_shared/cjs/filter-data-attrs-ajtUvDAC.js +15 -0
- package/dist/_shared/cjs/index-Bp6Dd2i1.js +94 -0
- package/dist/_shared/cjs/index.es-X428Cm3N.js +15 -0
- package/dist/_shared/cjs/tslib.es6-DBA0GFPJ.js +48 -0
- package/dist/_shared/esm/Author-Bx-cE9Pz.js +28 -0
- package/dist/_shared/esm/SectionHeading-C70XNhqJ.js +23 -0
- package/dist/_shared/esm/filter-data-attrs-V7cbJuwS.js +13 -0
- package/dist/_shared/esm/index-BfTCfPZ1.js +92 -0
- package/dist/_shared/esm/index.es-BzmvPxje.js +10 -0
- package/dist/_shared/esm/tslib.es6-Cv15O4Nx.js +46 -0
- package/dist/index.es.js +2796 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2808 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/components/Accordion/Accordion.d.ts +9 -0
- package/dist/types/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.d.ts +9 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Author/Author.d.ts +17 -0
- package/dist/types/components/Author/index.d.ts +1 -0
- package/dist/types/components/BannerWithTabs/BannerWithTabs.d.ts +17 -0
- package/dist/types/components/BannerWithTabs/index.d.ts +1 -0
- package/dist/types/components/CopyLead/CopyLead.d.ts +42 -0
- package/dist/types/components/CopyLead/components/Button/Button.d.ts +3 -0
- package/dist/types/components/CopyLead/components/Button/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Column/Column.d.ts +6 -0
- package/dist/types/components/CopyLead/components/Column/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Container/Container.d.ts +9 -0
- package/dist/types/components/CopyLead/components/Container/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/IconList/IconList.d.ts +8 -0
- package/dist/types/components/CopyLead/components/IconList/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/Image/Image.d.ts +3 -0
- package/dist/types/components/CopyLead/components/Image/index.d.ts +1 -0
- package/dist/types/components/CopyLead/components/MediaContent/MediaContent.d.ts +9 -0
- package/dist/types/components/CopyLead/components/MediaContent/index.d.ts +1 -0
- package/dist/types/components/CopyLead/index.d.ts +1 -0
- package/dist/types/components/CopyLead/templates/Content/Content.d.ts +10 -0
- package/dist/types/components/CopyLead/templates/Content/index.d.ts +1 -0
- package/dist/types/components/CopyLead/templates/Media/Media.d.ts +16 -0
- package/dist/types/components/CopyLead/templates/Media/index.d.ts +1 -0
- package/dist/types/components/CopyLead/types/copy-lead-button.d.ts +2 -0
- package/dist/types/components/CopyLead/types/copy-lead-image.d.ts +4 -0
- package/dist/types/components/CopyLead/types/copy-lead-list-item.d.ts +6 -0
- package/dist/types/components/CopyLead/types/copy-lead-transcript-link.d.ts +6 -0
- package/dist/types/components/CopyLead/types/index.d.ts +4 -0
- package/dist/types/components/DownloadList/DownloadList.d.ts +10 -0
- package/dist/types/components/DownloadList/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/FeaturePost.d.ts +45 -0
- package/dist/types/components/FeaturePost/components/Image/Image.d.ts +3 -0
- package/dist/types/components/FeaturePost/components/Image/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/components/MediaContent/MediaContent.d.ts +15 -0
- package/dist/types/components/FeaturePost/index.d.ts +1 -0
- package/dist/types/components/FeaturePost/types/feature-post-app-button-footer.d.ts +6 -0
- package/dist/types/components/FeaturePost/types/feature-post-cta-footer.d.ts +7 -0
- package/dist/types/components/FeaturePost/types/feature-post-image.d.ts +4 -0
- package/dist/types/components/FeaturePost/types/index.d.ts +3 -0
- package/dist/types/components/Highlights/Highlights.d.ts +17 -0
- package/dist/types/components/Highlights/components/HighlightItem/HighlightItem.d.ts +14 -0
- package/dist/types/components/Highlights/components/HighlightList/HighlightList.d.ts +9 -0
- package/dist/types/components/Highlights/index.d.ts +1 -0
- package/dist/types/components/Highlights/types/highlight-list-item.d.ts +10 -0
- package/dist/types/components/Highlights/types/index.d.ts +1 -0
- package/dist/types/components/PromoListing/PromoListing.d.ts +38 -0
- package/dist/types/components/PromoListing/index.d.ts +1 -0
- package/dist/types/components/Quote/Quote.d.ts +11 -0
- package/dist/types/components/Quote/index.d.ts +1 -0
- package/dist/types/components/SectionHeading/SectionHeading.d.ts +25 -0
- package/dist/types/components/SectionHeading/index.d.ts +1 -0
- package/dist/types/components/Statistics/Statistics.d.ts +7 -0
- package/dist/types/components/Statistics/helpers/get-link-props.d.ts +2 -0
- package/dist/types/components/Statistics/index.d.ts +1 -0
- package/dist/types/components/Statistics/types/statistic-link.d.ts +6 -0
- package/dist/types/components/Statistics/types/statistic.d.ts +8 -0
- package/dist/types/components/Summary/Summary.d.ts +18 -0
- package/dist/types/components/Summary/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +11 -0
- package/dist/types/index.d.ts +1 -0
- package/eslint.config.js +4 -0
- package/package.json +105 -0
- package/postcss.config.cjs +5 -0
- package/rollup.config.js +101 -0
- package/src/components/Accordion/Accordion.tsx +38 -0
- package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +44 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Author/Author.module.css +9 -0
- package/src/components/Author/Author.tsx +60 -0
- package/src/components/Author/index.ts +1 -0
- package/src/components/BannerWithTabs/BannerWithTabs.module.css +19 -0
- package/src/components/BannerWithTabs/BannerWithTabs.tsx +74 -0
- package/src/components/BannerWithTabs/index.ts +1 -0
- package/src/components/CopyLead/CopyLead.module.css +127 -0
- package/src/components/CopyLead/CopyLead.tsx +102 -0
- package/src/components/CopyLead/components/Button/Button.tsx +13 -0
- package/src/components/CopyLead/components/Button/index.ts +1 -0
- package/src/components/CopyLead/components/Column/Column.tsx +10 -0
- package/src/components/CopyLead/components/Column/index.ts +1 -0
- package/src/components/CopyLead/components/Container/Container.tsx +32 -0
- package/src/components/CopyLead/components/Container/index.ts +1 -0
- package/src/components/CopyLead/components/IconList/IconList.tsx +49 -0
- package/src/components/CopyLead/components/IconList/index.ts +1 -0
- package/src/components/CopyLead/components/Image/Image.tsx +17 -0
- package/src/components/CopyLead/components/Image/index.ts +1 -0
- package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +36 -0
- package/src/components/CopyLead/components/MediaContent/index.ts +1 -0
- package/src/components/CopyLead/index.ts +1 -0
- package/src/components/CopyLead/templates/Content/Content.tsx +58 -0
- package/src/components/CopyLead/templates/Content/index.ts +1 -0
- package/src/components/CopyLead/templates/Media/Media.tsx +104 -0
- package/src/components/CopyLead/templates/Media/index.ts +1 -0
- package/src/components/CopyLead/types/copy-lead-button.ts +6 -0
- package/src/components/CopyLead/types/copy-lead-image.ts +19 -0
- package/src/components/CopyLead/types/copy-lead-list-item.ts +7 -0
- package/src/components/CopyLead/types/copy-lead-transcript-link.ts +6 -0
- package/src/components/CopyLead/types/index.ts +4 -0
- package/src/components/DownloadList/DownloadList.module.css +7 -0
- package/src/components/DownloadList/DownloadList.tsx +41 -0
- package/src/components/DownloadList/index.ts +1 -0
- package/src/components/FeaturePost/FeaturePost.module.css +58 -0
- package/src/components/FeaturePost/FeaturePost.tsx +203 -0
- package/src/components/FeaturePost/components/Image/Image.tsx +18 -0
- package/src/components/FeaturePost/components/Image/index.ts +1 -0
- package/src/components/FeaturePost/components/MediaContent/MediaContent.tsx +45 -0
- package/src/components/FeaturePost/components/MediaContent/index.ts +0 -0
- package/src/components/FeaturePost/index.ts +1 -0
- package/src/components/FeaturePost/types/feature-post-app-button-footer.ts +7 -0
- package/src/components/FeaturePost/types/feature-post-cta-footer.ts +11 -0
- package/src/components/FeaturePost/types/feature-post-image.ts +19 -0
- package/src/components/FeaturePost/types/index.ts +3 -0
- package/src/components/Highlights/Highlights.module.css +85 -0
- package/src/components/Highlights/Highlights.tsx +53 -0
- package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +68 -0
- package/src/components/Highlights/components/HighlightList/HighlightList.tsx +42 -0
- package/src/components/Highlights/index.ts +1 -0
- package/src/components/Highlights/types/highlight-list-item.ts +11 -0
- package/src/components/Highlights/types/index.ts +1 -0
- package/src/components/PromoListing/PromoListing.module.css +97 -0
- package/src/components/PromoListing/PromoListing.tsx +153 -0
- package/src/components/PromoListing/index.ts +1 -0
- package/src/components/Quote/Quote.module.css +60 -0
- package/src/components/Quote/Quote.tsx +57 -0
- package/src/components/Quote/index.ts +1 -0
- package/src/components/SectionHeading/SectionHeading.module.css +34 -0
- package/src/components/SectionHeading/SectionHeading.tsx +65 -0
- package/src/components/SectionHeading/index.ts +1 -0
- package/src/components/Statistics/Statistics.module.css +25 -0
- package/src/components/Statistics/Statistics.tsx +97 -0
- package/src/components/Statistics/helpers/get-link-props.ts +11 -0
- package/src/components/Statistics/index.ts +1 -0
- package/src/components/Statistics/types/statistic-link.ts +6 -0
- package/src/components/Statistics/types/statistic.ts +9 -0
- package/src/components/Summary/Summary.module.css +31 -0
- package/src/components/Summary/Summary.tsx +65 -0
- package/src/components/Summary/index.ts +1 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +5 -0
- package/src/types/file-types.d.ts +9 -0
- package/stylelint.config.js +4 -0
- 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
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FeaturePost, type FeaturePostProps } from "./FeaturePost";
|
|
@@ -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,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 @@
|
|
|
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
|
+
}
|