@arc-ui/community-components 3.0.1 → 3.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 +17 -20
- package/CHANGELOG.md +18 -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 +6 -6
- package/lib/FAQs/FAQs.mjs +6 -6
- package/lib/FeaturePost/FeaturePost.cjs +6 -6
- package/lib/FeaturePost/FeaturePost.mjs +6 -6
- 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/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/_shared/cjs/{Accordion-D5fpUJzm.cjs → Accordion-BCJIm1Gq.cjs} +4 -4
- 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/filter-attrs-BizjMsy0.cjs +27 -0
- package/lib/_shared/cjs/{index.es-D11PdokQ.cjs → index.es-DzI6hGjj.cjs} +1 -1
- package/lib/_shared/esm/{Accordion-LLwNdzax.mjs → Accordion-BN_lZk6L.mjs} +4 -4
- 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/filter-attrs-DZ7RCEZm.mjs +25 -0
- package/lib/_shared/esm/{index.es-C4PyYMjI.mjs → index.es-B6Bolkcx.mjs} +1 -1
- package/lib/index.cjs +315 -217
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +155 -26
- package/lib/index.d.mts +155 -26
- package/lib/index.mjs +313 -218
- 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 +2 -2
- 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 +7 -3
- package/src/components/FeaturePost/FeaturePost.tsx +22 -5
- 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 +1 -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/Quote/Quote.tsx +2 -2
- package/src/components/SectionHeading/SectionHeading.tsx +17 -7
- package/src/components/Statistics/Statistics.tsx +6 -2
- package/src/components/index.ts +3 -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,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
|
}
|
|
@@ -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
|
*/
|
|
@@ -15,18 +15,22 @@ import { getLinkProps } from "./helpers/get-link-props";
|
|
|
15
15
|
import { type Statistic } from "./types/statistic";
|
|
16
16
|
|
|
17
17
|
export const Statistics: React.FC<StatisticsProps> = ({
|
|
18
|
+
id,
|
|
19
|
+
isHeadingWordWrap,
|
|
18
20
|
headingLevel,
|
|
19
21
|
heading,
|
|
20
22
|
content,
|
|
21
23
|
statistics,
|
|
22
24
|
}) => {
|
|
23
|
-
const
|
|
25
|
+
const componentId = useId();
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<Columns>
|
|
27
29
|
<ColumnsCol spanM={9}>
|
|
28
30
|
<SectionHeading
|
|
31
|
+
id={id}
|
|
29
32
|
heading={heading}
|
|
33
|
+
isHeadingWordWrap={isHeadingWordWrap}
|
|
30
34
|
headingLevel={headingLevel}
|
|
31
35
|
content={content}
|
|
32
36
|
/>
|
|
@@ -35,7 +39,7 @@ export const Statistics: React.FC<StatisticsProps> = ({
|
|
|
35
39
|
<ColumnsCol spanL={9}>
|
|
36
40
|
<ul className={styles.list}>
|
|
37
41
|
{statistics.map(({ stat, copy, link, source, sourceUrl }, i) => (
|
|
38
|
-
<li key={`statistic-${
|
|
42
|
+
<li key={`statistic-${componentId}-${i}`}>
|
|
39
43
|
{i !== 0 && (
|
|
40
44
|
<>
|
|
41
45
|
<VerticalSpace size="24" sizeS="32" sizeXL="40" />
|
package/src/components/index.ts
CHANGED
package/versions.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
["v3.0.1","v3.0.0","v2.0.0","v1.1.0","v1.0.2","v1.0.1","v1.0.0","v0.1.0"]
|
|
1
|
+
["v3.1.0","v3.0.1","v3.0.0","v2.0.0","v1.1.0","v1.0.2","v1.0.1","v1.0.0","v0.1.0"]
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var dataAttrRe = /^(data-.*)$/;
|
|
4
|
-
var filterDataAttrs = function (props) {
|
|
5
|
-
var filteredProps = {};
|
|
6
|
-
for (var prop in props) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) &&
|
|
8
|
-
dataAttrRe.test(prop)) {
|
|
9
|
-
filteredProps[prop] = props[prop];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return filteredProps;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.filterDataAttrs = filterDataAttrs;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var dataAttrRe = /^(data-.*)$/;
|
|
2
|
-
var filterDataAttrs = function (props) {
|
|
3
|
-
var filteredProps = {};
|
|
4
|
-
for (var prop in props) {
|
|
5
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) &&
|
|
6
|
-
dataAttrRe.test(prop)) {
|
|
7
|
-
filteredProps[prop] = props[prop];
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return filteredProps;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { filterDataAttrs as f };
|