@arc-ui/community-components 3.0.1 → 3.2.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 +19 -22
- package/CHANGELOG.md +30 -0
- package/lib/Accordion/Accordion.cjs +2 -2
- package/lib/Accordion/Accordion.mjs +2 -2
- package/lib/ActionTile/ActionTile.cjs +35 -0
- package/lib/ActionTile/ActionTile.mjs +33 -0
- package/lib/ActionTile/styles.css +1 -0
- package/lib/ArticleSidebar/ArticleSidebar.cjs +68 -58
- package/lib/ArticleSidebar/ArticleSidebar.mjs +68 -58
- package/lib/ArticleSidebar/styles.css +1 -1
- package/lib/Author/Author.cjs +2 -2
- package/lib/Author/Author.mjs +2 -2
- package/lib/BannerWithTabs/BannerWithTabs.cjs +5 -5
- package/lib/BannerWithTabs/BannerWithTabs.mjs +5 -5
- package/lib/CopyLead/CopyLead.cjs +12 -12
- package/lib/CopyLead/CopyLead.mjs +12 -12
- package/lib/DownloadList/DownloadList.cjs +5 -5
- package/lib/DownloadList/DownloadList.mjs +5 -5
- package/lib/FAQs/FAQs.cjs +16 -12
- package/lib/FAQs/FAQs.mjs +16 -12
- package/lib/FeaturePost/FeaturePost.cjs +18 -11
- package/lib/FeaturePost/FeaturePost.mjs +18 -11
- package/lib/HeroLink/HeroLink.cjs +35 -0
- package/lib/HeroLink/HeroLink.mjs +33 -0
- package/lib/HeroLink/styles.css +1 -0
- package/lib/Highlights/Highlights.cjs +9 -16
- package/lib/Highlights/Highlights.mjs +7 -14
- package/lib/LinkTile/LinkTile.cjs +21 -0
- package/lib/LinkTile/LinkTile.mjs +19 -0
- package/lib/LinkTile/styles.css +1 -0
- package/lib/ProductNavigation/ProductNavigation.cjs +10 -13
- package/lib/ProductNavigation/ProductNavigation.mjs +10 -13
- package/lib/PromoListing/PromoListing.cjs +17 -9
- package/lib/PromoListing/PromoListing.mjs +17 -9
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +28 -0
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +26 -0
- package/lib/PromoListingThumbnailSignpost/styles.css +1 -0
- package/lib/Quote/Quote.cjs +3 -3
- package/lib/Quote/Quote.mjs +3 -3
- package/lib/SectionHeading/SectionHeading.cjs +3 -3
- package/lib/SectionHeading/SectionHeading.mjs +3 -3
- package/lib/Statistics/Statistics.cjs +6 -6
- package/lib/Statistics/Statistics.mjs +6 -6
- package/lib/Summary/Summary.cjs +1 -1
- package/lib/Summary/Summary.mjs +1 -1
- package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +15 -0
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +9 -0
- package/lib/ThumbnailSignpost/styles.css +1 -0
- package/lib/_shared/cjs/{Accordion-D5fpUJzm.cjs → Accordion-DfNGOjTm.cjs} +5 -5
- package/lib/_shared/cjs/{Author-X47pv31V.cjs → Author-D4dKNQem.cjs} +2 -2
- package/lib/_shared/cjs/BtIconArrowAltRight-CLQdP61r.cjs +11 -0
- package/lib/_shared/cjs/BtIconArrowRightFill-BVCZv7Lm.cjs +11 -0
- package/lib/_shared/cjs/{SectionHeading-DepTV4JA.cjs → SectionHeading-DeSFM0HV.cjs} +5 -5
- package/lib/_shared/cjs/ThumbnailSignpost-GkOiwt-Z.cjs +39 -0
- package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +27 -0
- package/lib/_shared/cjs/{index.es-D11PdokQ.cjs → index.es-Dq8bYrbW.cjs} +1 -1
- package/lib/_shared/esm/{Accordion-LLwNdzax.mjs → Accordion-cd1oYvBv.mjs} +5 -5
- package/lib/_shared/esm/{Author-CydDYCma.mjs → Author-HnYsFTPT.mjs} +2 -2
- package/lib/_shared/esm/BtIconArrowAltRight-VH6RTTnL.mjs +9 -0
- package/lib/_shared/esm/BtIconArrowRightFill-D0zKgk3B.mjs +9 -0
- package/lib/_shared/esm/{SectionHeading-BayinGP_.mjs → SectionHeading-CpDLCndw.mjs} +5 -5
- package/lib/_shared/esm/ThumbnailSignpost-BeRiXbUp.mjs +37 -0
- package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +25 -0
- package/lib/_shared/esm/{index.es-C4PyYMjI.mjs → index.es-Bfdys5__.mjs} +1 -1
- package/lib/index.cjs +378 -227
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +190 -26
- package/lib/index.d.mts +190 -26
- package/lib/index.mjs +374 -228
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +13 -13
- package/src/components/Accordion/Accordion.tsx +3 -2
- package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +3 -3
- package/src/components/Accordion/components/AccordionHeading/AccordionHeading.tsx +3 -4
- package/src/components/ActionTile/ActionTile.module.css +89 -0
- package/src/components/ActionTile/ActionTile.tsx +70 -0
- package/src/components/ActionTile/index.ts +1 -0
- package/src/components/ArticleSidebar/ArticleSidebar.module.css +6 -0
- package/src/components/ArticleSidebar/ArticleSidebar.tsx +115 -85
- package/src/components/ArticleSidebar/types/link-section.ts +2 -1
- package/src/components/ArticleSidebar/types/share-button.ts +1 -1
- package/src/components/ArticleSidebar/types/share.ts +5 -1
- package/src/components/ArticleSidebar/types/text-section.ts +3 -2
- package/src/components/ArticleSidebar/types/topic.ts +2 -2
- package/src/components/Author/Author.tsx +2 -2
- package/src/components/BannerWithTabs/BannerWithTabs.tsx +9 -3
- package/src/components/CopyLead/CopyLead.tsx +21 -5
- package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +10 -1
- package/src/components/CopyLead/templates/Content/Content.tsx +4 -0
- package/src/components/CopyLead/templates/Media/Media.tsx +10 -1
- package/src/components/CopyLead/types/copy-lead-button.ts +1 -1
- package/src/components/CopyLead/types/copy-lead-image.ts +1 -1
- package/src/components/DownloadList/DownloadList.tsx +4 -0
- package/src/components/FAQs/FAQs.tsx +20 -9
- package/src/components/FeaturePost/FeaturePost.tsx +27 -6
- package/src/components/FeaturePost/components/Image/Image.tsx +31 -7
- package/src/components/FeaturePost/types/feature-post-app-button-footer.ts +1 -1
- package/src/components/FeaturePost/types/feature-post-cta-footer.ts +2 -1
- package/src/components/FeaturePost/types/feature-post-image.ts +3 -1
- package/src/components/HeroLink/HeroLink.module.css +44 -0
- package/src/components/HeroLink/HeroLink.tsx +136 -0
- package/src/components/HeroLink/index.ts +2 -0
- package/src/components/Highlights/Highlights.tsx +6 -1
- package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +1 -0
- package/src/components/Highlights/types/highlight-link.ts +1 -0
- package/src/components/LinkTile/LinkTile.module.css +57 -0
- package/src/components/LinkTile/LinkTile.tsx +38 -0
- package/src/components/LinkTile/index.ts +1 -0
- package/src/components/ProductNavigation/ProductNavigation.tsx +10 -11
- package/src/components/ProductNavigation/types/product-list.ts +1 -8
- package/src/components/PromoListing/PromoListing.tsx +67 -3
- package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.module.css +54 -0
- package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +53 -0
- package/src/components/PromoListingThumbnailSignpost/index.ts +4 -0
- package/src/components/Quote/Quote.tsx +2 -2
- package/src/components/SectionHeading/SectionHeading.tsx +17 -7
- package/src/components/Statistics/Statistics.tsx +6 -2
- package/src/components/ThumbnailSignpost/ThumbnailSignpost.module.css +112 -0
- package/src/components/ThumbnailSignpost/ThumbnailSignpost.tsx +100 -0
- package/src/components/ThumbnailSignpost/index.ts +4 -0
- package/src/components/index.ts +5 -0
- package/versions.json +1 -1
- package/lib/_shared/cjs/filter-data-attrs-ajtUvDAC.cjs +0 -15
- package/lib/_shared/esm/filter-data-attrs-V7cbJuwS.mjs +0 -13
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { type Ref } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { BtIconArrowAltRight } from "@arc-ui/icons/BtIconArrowAltRight";
|
|
4
|
+
import { Icon } from "@arc-ui/components/Icon";
|
|
5
|
+
import styles from "./HeroLink.module.css";
|
|
6
|
+
|
|
7
|
+
export type ElementUnion = HTMLButtonElement | HTMLAnchorElement;
|
|
8
|
+
export type ButtonRef = Ref<ElementUnion> | null;
|
|
9
|
+
type AnchorElProps = React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
10
|
+
type ButtonElProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
11
|
+
type CommonElProps = AnchorElProps & ButtonElProps & { ref?: ButtonRef | null };
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Pill-style HeroLink component with default and hover states
|
|
15
|
+
*/
|
|
16
|
+
export const HeroLink = ({
|
|
17
|
+
label,
|
|
18
|
+
onClick,
|
|
19
|
+
href,
|
|
20
|
+
id,
|
|
21
|
+
rel,
|
|
22
|
+
target,
|
|
23
|
+
ariaLabel,
|
|
24
|
+
ref,
|
|
25
|
+
...props
|
|
26
|
+
}: HeroLinkProps) => {
|
|
27
|
+
const HeroLinkClasses = classNames(styles.heroLink, {
|
|
28
|
+
[styles["heroLink--emptyLabel"]]: !label,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const commonProps: CommonElProps = {
|
|
32
|
+
id,
|
|
33
|
+
onClick,
|
|
34
|
+
ref,
|
|
35
|
+
...props,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (href) {
|
|
39
|
+
return (
|
|
40
|
+
<a
|
|
41
|
+
{...(commonProps as AnchorElProps)}
|
|
42
|
+
className={HeroLinkClasses}
|
|
43
|
+
href={href}
|
|
44
|
+
rel={rel}
|
|
45
|
+
aria-label={ariaLabel}
|
|
46
|
+
target={target}
|
|
47
|
+
>
|
|
48
|
+
<span className={styles["heroLink-inner"]}>
|
|
49
|
+
{label && <span className={styles["heroLink-label"]}>{label}</span>}
|
|
50
|
+
<span className={styles["heroLink-icon"]}>
|
|
51
|
+
<Icon
|
|
52
|
+
testId="hero-link-icon"
|
|
53
|
+
size={24}
|
|
54
|
+
icon={BtIconArrowAltRight}
|
|
55
|
+
/>
|
|
56
|
+
</span>
|
|
57
|
+
</span>
|
|
58
|
+
</a>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return (
|
|
62
|
+
<button
|
|
63
|
+
{...(commonProps as ButtonElProps)}
|
|
64
|
+
className={HeroLinkClasses}
|
|
65
|
+
aria-label={ariaLabel}
|
|
66
|
+
>
|
|
67
|
+
<span className={styles["heroLink-inner"]}>
|
|
68
|
+
{label && <span className={styles["heroLink-label"]}>{label}</span>}
|
|
69
|
+
<span className={styles["heroLink-icon"]}>
|
|
70
|
+
<Icon testId="hero-link-icon" size={24} icon={BtIconArrowAltRight} />
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
73
|
+
</button>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
interface LinkElementProps {
|
|
78
|
+
/**
|
|
79
|
+
* URL to link to if `HeroButton` elementType is 'a'.
|
|
80
|
+
*/
|
|
81
|
+
href?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Target window for the `HeroButton` href URL.
|
|
85
|
+
*/
|
|
86
|
+
target?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Relationship between the Button href URL and the current page. See
|
|
90
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
|
|
91
|
+
*/
|
|
92
|
+
rel?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface HeroButtonElementProps {
|
|
96
|
+
/**
|
|
97
|
+
* Default behavior of the Button element. If not provided, 'submit' will
|
|
98
|
+
* be inferred. Type 'reset' deliberately excluded.
|
|
99
|
+
*/
|
|
100
|
+
type?: "button" | "submit";
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Refers to the id of a form so it can be submitted if the button exists outside of it.
|
|
104
|
+
*/
|
|
105
|
+
form?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface HeroLinkProps
|
|
109
|
+
extends HeroButtonElementProps,
|
|
110
|
+
LinkElementProps {
|
|
111
|
+
/**
|
|
112
|
+
* Label for `HeroLink`
|
|
113
|
+
*/
|
|
114
|
+
label?: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Optional click handler for the `HeroLink`.
|
|
118
|
+
*/
|
|
119
|
+
onClick?: () => void;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Optional property to provide component Ref
|
|
123
|
+
*/
|
|
124
|
+
ref?: ButtonRef;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Text to override `label` with additional, more precise information
|
|
128
|
+
* specifically for screen reader users.
|
|
129
|
+
*/
|
|
130
|
+
ariaLabel?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* HTML ID for the `HeroLink`
|
|
134
|
+
*/
|
|
135
|
+
id?: string;
|
|
136
|
+
}
|
|
@@ -16,6 +16,8 @@ import { type HighlightListItem } from "./types";
|
|
|
16
16
|
export const Highlights: React.FC<HighlightsProps> = ({
|
|
17
17
|
heading,
|
|
18
18
|
headingLevel,
|
|
19
|
+
id,
|
|
20
|
+
isHeadingWordWrap,
|
|
19
21
|
content,
|
|
20
22
|
listItems,
|
|
21
23
|
columns = "2",
|
|
@@ -27,9 +29,11 @@ export const Highlights: React.FC<HighlightsProps> = ({
|
|
|
27
29
|
<div>
|
|
28
30
|
<SectionHeading
|
|
29
31
|
isPadded
|
|
32
|
+
id={id}
|
|
30
33
|
data-testid="highlights-header"
|
|
31
34
|
heading={heading}
|
|
32
35
|
headingLevel={headingLevel}
|
|
36
|
+
isHeadingWordWrap={isHeadingWordWrap}
|
|
33
37
|
content={content}
|
|
34
38
|
/>
|
|
35
39
|
|
|
@@ -49,6 +53,7 @@ export const Highlights: React.FC<HighlightsProps> = ({
|
|
|
49
53
|
href={cta.href}
|
|
50
54
|
onClick={cta.onClick}
|
|
51
55
|
size="m"
|
|
56
|
+
ariaLabel={cta.ariaLabel}
|
|
52
57
|
buttonStyle={cta.buttonStyle}
|
|
53
58
|
icon={
|
|
54
59
|
cta.buttonStyle === "compact"
|
|
@@ -92,7 +97,7 @@ export interface HighlightsProps extends Omit<SectionHeadingProps, "isPadded"> {
|
|
|
92
97
|
*/
|
|
93
98
|
export type HighlightsCTAProps = Pick<
|
|
94
99
|
ButtonV2Props,
|
|
95
|
-
"label" | "href" | "onClick" | "iconPosition"
|
|
100
|
+
"label" | "href" | "onClick" | "iconPosition" | "ariaLabel"
|
|
96
101
|
> & {
|
|
97
102
|
/**
|
|
98
103
|
* Allowed button styles only.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.link-tile {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 306px;
|
|
5
|
+
border: 1px solid #c8c8c8;
|
|
6
|
+
border-radius: 32px;
|
|
7
|
+
padding: 24px;
|
|
8
|
+
background: #ffffff;
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
transition:
|
|
12
|
+
border-color 0.2s ease,
|
|
13
|
+
border-radius 0.2s ease;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.link-tile-content {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.link-tile-text {
|
|
24
|
+
font-family: "BT Curve", sans-serif;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
line-height: 24px;
|
|
28
|
+
letter-spacing: 0;
|
|
29
|
+
color: #5514b4;
|
|
30
|
+
transition: color 0.2s ease;
|
|
31
|
+
flex: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link-tile .link-tile-content svg {
|
|
35
|
+
color: #5514b4;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
transition: color 0.2s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.link-tile:hover {
|
|
41
|
+
border-color: #5514b4;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.link-tile:active {
|
|
45
|
+
border-radius: 32px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.link-tile:hover .link-tile-text,
|
|
49
|
+
.link-tile:hover .link-tile-content svg {
|
|
50
|
+
color: #3f187f;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (width <= 1023px) {
|
|
54
|
+
.link-tile {
|
|
55
|
+
padding: 24px 16px 24px 24px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import styles from "./LinkTile.module.css";
|
|
4
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
5
|
+
import { Icon } from "@arc-ui/components/Icon";
|
|
6
|
+
import { BtIconArrowAltRight } from "@arc-ui/icons/BtIconArrowAltRight";
|
|
7
|
+
|
|
8
|
+
export const LinkTile: React.FC<LinkTileProps> = ({
|
|
9
|
+
text,
|
|
10
|
+
href,
|
|
11
|
+
showIcon = true,
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
const Component = href ? "a" : "div";
|
|
16
|
+
const linkProps = href ? { href } : {};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Component
|
|
20
|
+
className={classNames(styles["link-tile"], className)}
|
|
21
|
+
{...linkProps}
|
|
22
|
+
{...filterAttrs(props)}
|
|
23
|
+
>
|
|
24
|
+
{text && (
|
|
25
|
+
<div className={styles["link-tile-content"]}>
|
|
26
|
+
<span className={styles["link-tile-text"]}>{text}</span>
|
|
27
|
+
{showIcon && <Icon icon={BtIconArrowAltRight} size={32} />}
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
</Component>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export interface LinkTileProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
text?: string;
|
|
36
|
+
href?: string;
|
|
37
|
+
showIcon?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinkTile, type LinkTileProps } from "./LinkTile";
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import styles from "./ProductNavigation.module.css";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
6
6
|
|
|
7
7
|
import { useMediaQuery } from "@arc-ui/components/use-media-query";
|
|
8
8
|
import { ArcSizeBreakpointsS } from "@arc-ui/tokens-arc";
|
|
@@ -19,7 +19,9 @@ import { VisuallyHidden } from "@arc-ui/components/VisuallyHidden";
|
|
|
19
19
|
*/
|
|
20
20
|
export const ProductNavigation: React.FC<ProductNavigationProps> = ({
|
|
21
21
|
heading,
|
|
22
|
+
id,
|
|
22
23
|
headingLevel,
|
|
24
|
+
isHeadingWordWrap,
|
|
23
25
|
content,
|
|
24
26
|
hideButton = false,
|
|
25
27
|
productList,
|
|
@@ -79,17 +81,19 @@ export const ProductNavigation: React.FC<ProductNavigationProps> = ({
|
|
|
79
81
|
);
|
|
80
82
|
|
|
81
83
|
return (
|
|
82
|
-
<div {...
|
|
84
|
+
<div {...filterAttrs(props)}>
|
|
83
85
|
<SectionHeading
|
|
84
86
|
isPadded
|
|
87
|
+
id={id}
|
|
85
88
|
data-testid="ProductNavigation-header"
|
|
86
89
|
heading={heading}
|
|
87
90
|
headingLevel={headingLevel}
|
|
91
|
+
isHeadingWordWrap={isHeadingWordWrap}
|
|
88
92
|
content={content}
|
|
89
93
|
image={image}
|
|
90
94
|
/>
|
|
91
95
|
<ul className={classNames(styles["product-navigation-grid"])}>
|
|
92
|
-
{displayList?.map((
|
|
96
|
+
{displayList?.map((cardProps, i) => (
|
|
93
97
|
<li
|
|
94
98
|
key={`displayList-${i}`}
|
|
95
99
|
tabIndex={-1}
|
|
@@ -97,14 +101,9 @@ export const ProductNavigation: React.FC<ProductNavigationProps> = ({
|
|
|
97
101
|
data-cy={`list-item-${i}`}
|
|
98
102
|
>
|
|
99
103
|
<InformationCard
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}}
|
|
104
|
-
minHeight={minHeight}
|
|
105
|
-
heading={heading}
|
|
106
|
-
headingLevel="2"
|
|
107
|
-
text={text}
|
|
104
|
+
{...cardProps}
|
|
105
|
+
minHeight={minHeight ?? cardProps.minHeight}
|
|
106
|
+
headingLevel={cardProps.headingLevel ?? "2"}
|
|
108
107
|
/>
|
|
109
108
|
</li>
|
|
110
109
|
))}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { InformationCardProps } from "@arc-ui/components/InformationCard";
|
|
2
|
-
import { ButtonV2Props } from "@arc-ui/components/types/components/ButtonV2/ButtonV2";
|
|
3
2
|
|
|
4
|
-
type
|
|
5
|
-
ButtonV2Props,
|
|
6
|
-
"label" | "onClick" | "href"
|
|
7
|
-
>;
|
|
8
|
-
type ListInformationCardProps = Pick<InformationCardProps, "heading" | "text">;
|
|
9
|
-
export type ListProps = ListInformationCardButtonProps &
|
|
10
|
-
ListInformationCardProps;
|
|
3
|
+
export type ListProps = InformationCardProps;
|
|
@@ -5,6 +5,7 @@ import classNames from "classnames";
|
|
|
5
5
|
import { ArcSizeBreakpointsL, ArcSizeBreakpointsM } from "@arc-ui/tokens-arc";
|
|
6
6
|
|
|
7
7
|
import { Carousel } from "@arc-ui/components/Carousel";
|
|
8
|
+
import { Heading, type HeadingLevel } from "@arc-ui/components/Heading";
|
|
8
9
|
import { useMediaQuery } from "@arc-ui/components/use-media-query";
|
|
9
10
|
|
|
10
11
|
import { SectionHeading, type SectionHeadingProps } from "../SectionHeading";
|
|
@@ -26,7 +27,12 @@ import {
|
|
|
26
27
|
type TypographyCardProps,
|
|
27
28
|
} from "@arc-ui/components/TypographyCard";
|
|
28
29
|
|
|
30
|
+
import { ButtonV2, type ButtonV2Props } from "@arc-ui/components/ButtonV2";
|
|
31
|
+
|
|
32
|
+
import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
|
|
33
|
+
|
|
29
34
|
import styles from "./PromoListing.module.css";
|
|
35
|
+
import { BtIconArrowRightFill } from "@arc-ui/icons";
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* Use `PromoListing` to give supporting information about a page or proposition in the form of the card components (`ImpactCard`, `InformationCard`, `MediaCard` and `TypographyCard`).
|
|
@@ -34,12 +40,17 @@ import styles from "./PromoListing.module.css";
|
|
|
34
40
|
export const PromoListing: React.FC<PromoListingProps> = ({
|
|
35
41
|
heading,
|
|
36
42
|
content,
|
|
43
|
+
id,
|
|
37
44
|
isCarousel = false,
|
|
38
45
|
cards,
|
|
39
46
|
headingLevel,
|
|
47
|
+
isHeadingWordWrap,
|
|
40
48
|
columns = "2",
|
|
49
|
+
button = { buttonStyle: "secondary" },
|
|
50
|
+
overlineHeadingLevel,
|
|
51
|
+
overlineLabel,
|
|
41
52
|
}) => {
|
|
42
|
-
const
|
|
53
|
+
const componentId = useId();
|
|
43
54
|
|
|
44
55
|
const isMinWidthArcBreakpointL = useMediaQuery(
|
|
45
56
|
`(min-width: ${ArcSizeBreakpointsL})`,
|
|
@@ -87,13 +98,37 @@ export const PromoListing: React.FC<PromoListingProps> = ({
|
|
|
87
98
|
|
|
88
99
|
return (
|
|
89
100
|
<div className={styles.PromoListing}>
|
|
101
|
+
{overlineLabel && (
|
|
102
|
+
<>
|
|
103
|
+
<Heading level={overlineHeadingLevel} fontStyle="overline">
|
|
104
|
+
{overlineLabel}
|
|
105
|
+
</Heading>
|
|
106
|
+
<VerticalSpace size="12" />
|
|
107
|
+
</>
|
|
108
|
+
)}
|
|
109
|
+
|
|
90
110
|
<SectionHeading
|
|
91
111
|
isPadded
|
|
112
|
+
id={id}
|
|
92
113
|
data-testid="PromoListing-header"
|
|
93
114
|
heading={heading}
|
|
115
|
+
isHeadingWordWrap={isHeadingWordWrap}
|
|
94
116
|
headingLevel={headingLevel}
|
|
95
117
|
content={content}
|
|
96
118
|
/>
|
|
119
|
+
|
|
120
|
+
{button.label && (
|
|
121
|
+
<>
|
|
122
|
+
<ButtonV2
|
|
123
|
+
{...button}
|
|
124
|
+
icon={
|
|
125
|
+
button.buttonStyle == "compact" ? BtIconArrowRightFill : undefined
|
|
126
|
+
}
|
|
127
|
+
size="m"
|
|
128
|
+
/>
|
|
129
|
+
<VerticalSpace size="40" />
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
97
132
|
{isCarousel && !isMinWidthArcBreakpointL ? (
|
|
98
133
|
<div className={styles.promolistingCarouselWrapper}>
|
|
99
134
|
<Carousel
|
|
@@ -104,7 +139,7 @@ export const PromoListing: React.FC<PromoListingProps> = ({
|
|
|
104
139
|
>
|
|
105
140
|
{cards?.map((card: PromoListCard, i) => (
|
|
106
141
|
<div
|
|
107
|
-
key={`promolist-carousel-card-${
|
|
142
|
+
key={`promolist-carousel-card-${componentId}-${i}`}
|
|
108
143
|
className={(styles.carouselSlide, styles.cardWrapperCarousel)}
|
|
109
144
|
>
|
|
110
145
|
{getCard(card)}
|
|
@@ -117,7 +152,7 @@ export const PromoListing: React.FC<PromoListingProps> = ({
|
|
|
117
152
|
className={classNames(styles.cardGrid, styles[`columns-${columns}`])}
|
|
118
153
|
>
|
|
119
154
|
{cards?.map((card: PromoListCard, index) => (
|
|
120
|
-
<li key={`promolist-card--${
|
|
155
|
+
<li key={`promolist-card--${componentId}-${index}`}>
|
|
121
156
|
<div
|
|
122
157
|
data-testid={`promoList-card${index}`}
|
|
123
158
|
className={styles.cardWrapper}
|
|
@@ -170,4 +205,33 @@ export interface PromoListingProps
|
|
|
170
205
|
* Number of columns for desktop breakpoints. "2" and "3" column options available.
|
|
171
206
|
*/
|
|
172
207
|
columns?: "2" | "3";
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Optional button configuration displayed above the cards.
|
|
211
|
+
*/
|
|
212
|
+
button?: PromoListingButton;
|
|
213
|
+
/**
|
|
214
|
+
* Text label displayed above the main heading in overline style
|
|
215
|
+
*/
|
|
216
|
+
overlineLabel?: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Heading level for the overline label
|
|
220
|
+
*/
|
|
221
|
+
overlineHeadingLevel?: HeadingLevel;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Button configuration for PromoListing component.
|
|
226
|
+
*/
|
|
227
|
+
interface PromoListingButton
|
|
228
|
+
extends Omit<ButtonV2Props, "buttonStyle" | "icon" | "size"> {
|
|
229
|
+
/**
|
|
230
|
+
* Style variant for the button. Defaults to "secondary".
|
|
231
|
+
*/
|
|
232
|
+
buttonStyle?: "secondary" | "compact";
|
|
233
|
+
/**
|
|
234
|
+
* Optional prop to pass additional props to the button. Only data-* and aria-* will work.
|
|
235
|
+
*/
|
|
236
|
+
[key: string]: unknown;
|
|
173
237
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import url("@arc-ui/tokens-arc/dist/custom-media.css");
|
|
2
|
+
|
|
3
|
+
.PromoListingThumbnailSignpost {
|
|
4
|
+
max-width: 1280px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.PromoListingThumbnailSignpost ul,
|
|
8
|
+
.PromoListingThumbnailSignpost li {
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
padding: 0;
|
|
11
|
+
margin: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.list {
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: repeat(12, 1fr);
|
|
17
|
+
column-gap: var(--arc-size-grid-gutter-s);
|
|
18
|
+
row-gap: 24px;
|
|
19
|
+
list-style: none;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.list li {
|
|
25
|
+
grid-column: span 12;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (--arc-custom-media-min-width-s-px) {
|
|
29
|
+
.list {
|
|
30
|
+
row-gap: 32px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (--arc-custom-media-min-width-m-px) {
|
|
35
|
+
.list {
|
|
36
|
+
column-gap: var(--arc-size-grid-gutter-m);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.list li {
|
|
40
|
+
grid-column: span 6;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (--arc-custom-media-min-width-l-px) {
|
|
45
|
+
.list {
|
|
46
|
+
row-gap: 40px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (--arc-custom-media-min-width-xl-px) {
|
|
51
|
+
.list {
|
|
52
|
+
column-gap: var(--arc-size-grid-gutter-l);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { SectionHeading, type SectionHeadingProps } from "../SectionHeading";
|
|
4
|
+
|
|
5
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
6
|
+
|
|
7
|
+
import styles from "./PromoListingThumbnailSignpost.module.css";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ThumbnailSignpost,
|
|
11
|
+
type ThumbnailSignpostProps,
|
|
12
|
+
} from "../ThumbnailSignpost";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Use `PromoListingThumbnailSignpost` to give supporting information about a page or proposition in the form of the ThumbnailSignposts components.
|
|
16
|
+
*/
|
|
17
|
+
export const PromoListingThumbnailSignpost: React.FC<
|
|
18
|
+
PromoListingThumbnailSignpostProps
|
|
19
|
+
> = ({
|
|
20
|
+
isPadded = true,
|
|
21
|
+
heading,
|
|
22
|
+
content,
|
|
23
|
+
headingLevel,
|
|
24
|
+
thumbnailList,
|
|
25
|
+
...props
|
|
26
|
+
}) => {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
className={styles.PromoListingThumbnailSignpost}
|
|
30
|
+
{...filterAttrs(props)}
|
|
31
|
+
>
|
|
32
|
+
<SectionHeading
|
|
33
|
+
isPadded={isPadded}
|
|
34
|
+
data-testid="PromoListingThumbnailSignpost-header"
|
|
35
|
+
heading={heading}
|
|
36
|
+
headingLevel={headingLevel}
|
|
37
|
+
content={content}
|
|
38
|
+
/>
|
|
39
|
+
<ul className={styles.list}>
|
|
40
|
+
{thumbnailList.map((thumbnail, index) => (
|
|
41
|
+
<li key={index}>
|
|
42
|
+
<ThumbnailSignpost {...thumbnail} />
|
|
43
|
+
</li>
|
|
44
|
+
))}
|
|
45
|
+
</ul>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export interface PromoListingThumbnailSignpostProps
|
|
51
|
+
extends SectionHeadingProps {
|
|
52
|
+
thumbnailList: ThumbnailSignpostProps[];
|
|
53
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
5
5
|
|
|
6
6
|
import { Author } from "../Author";
|
|
7
7
|
import { AuthorProps } from "../Author/Author";
|
|
@@ -21,7 +21,7 @@ export const Quote: React.FC<QuoteProps> = ({
|
|
|
21
21
|
<div
|
|
22
22
|
className="community-component--quote"
|
|
23
23
|
data-testid="quote-test"
|
|
24
|
-
{...
|
|
24
|
+
{...filterAttrs(props)}
|
|
25
25
|
>
|
|
26
26
|
<blockquote
|
|
27
27
|
data-testid="style-test"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
5
5
|
|
|
6
|
-
import { Heading, type HeadingLevel } from "@arc-ui/components/Heading";
|
|
7
6
|
import { Text } from "@arc-ui/components/Text";
|
|
8
7
|
import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
|
|
9
|
-
import { Image } from "@arc-ui/components/Image";
|
|
10
|
-
import { type
|
|
8
|
+
import { Image, type ImageProps } from "@arc-ui/components/Image";
|
|
9
|
+
import { Heading, type HeadingLevel } from "@arc-ui/components/Heading";
|
|
11
10
|
|
|
12
11
|
import styles from "./SectionHeading.module.css";
|
|
13
12
|
|
|
@@ -15,9 +14,10 @@ export const SectionHeading: React.FC<SectionHeadingProps> = ({
|
|
|
15
14
|
heading,
|
|
16
15
|
content,
|
|
17
16
|
id,
|
|
17
|
+
image,
|
|
18
|
+
isHeadingWordWrap,
|
|
18
19
|
isPadded = false,
|
|
19
20
|
headingLevel = "2",
|
|
20
|
-
image,
|
|
21
21
|
...props
|
|
22
22
|
}) => (
|
|
23
23
|
<div
|
|
@@ -25,7 +25,7 @@ export const SectionHeading: React.FC<SectionHeadingProps> = ({
|
|
|
25
25
|
[styles["section-header"]]: true,
|
|
26
26
|
[styles["section-header--padded"]]: isPadded,
|
|
27
27
|
})}
|
|
28
|
-
{...
|
|
28
|
+
{...filterAttrs(props)}
|
|
29
29
|
>
|
|
30
30
|
<div
|
|
31
31
|
className={classNames({ [styles["section-header--hasImage"]]: image })}
|
|
@@ -35,7 +35,12 @@ export const SectionHeading: React.FC<SectionHeadingProps> = ({
|
|
|
35
35
|
<Image {...image} width={68} fit="cover" />
|
|
36
36
|
</div>
|
|
37
37
|
)}
|
|
38
|
-
<Heading
|
|
38
|
+
<Heading
|
|
39
|
+
level={headingLevel}
|
|
40
|
+
id={id}
|
|
41
|
+
size="xl"
|
|
42
|
+
isWordWrap={isHeadingWordWrap}
|
|
43
|
+
>
|
|
39
44
|
{heading}
|
|
40
45
|
</Heading>
|
|
41
46
|
</div>
|
|
@@ -66,6 +71,11 @@ export interface SectionHeadingProps {
|
|
|
66
71
|
*/
|
|
67
72
|
headingLevel?: HeadingLevel;
|
|
68
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Word wrap behavior for the heading
|
|
76
|
+
*/
|
|
77
|
+
isHeadingWordWrap?: boolean;
|
|
78
|
+
|
|
69
79
|
/**
|
|
70
80
|
* Text content for `SectionHeading`.
|
|
71
81
|
*/
|