@arc-ui/community-components 3.0.0 → 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.
Files changed (112) hide show
  1. package/.turbo/turbo-build.log +16 -19
  2. package/CHANGELOG.md +24 -0
  3. package/lib/Accordion/Accordion.cjs +2 -2
  4. package/lib/Accordion/Accordion.mjs +2 -2
  5. package/lib/Accordion/styles.css +1 -0
  6. package/lib/ActionTile/ActionTile.cjs +35 -0
  7. package/lib/ActionTile/ActionTile.mjs +33 -0
  8. package/lib/ActionTile/styles.css +1 -0
  9. package/lib/ArticleSidebar/ArticleSidebar.cjs +68 -58
  10. package/lib/ArticleSidebar/ArticleSidebar.mjs +68 -58
  11. package/lib/ArticleSidebar/styles.css +1 -1
  12. package/lib/Author/Author.cjs +2 -2
  13. package/lib/Author/Author.mjs +2 -2
  14. package/lib/BannerWithTabs/BannerWithTabs.cjs +5 -5
  15. package/lib/BannerWithTabs/BannerWithTabs.mjs +5 -5
  16. package/lib/CopyLead/CopyLead.cjs +12 -12
  17. package/lib/CopyLead/CopyLead.mjs +12 -12
  18. package/lib/DownloadList/DownloadList.cjs +5 -5
  19. package/lib/DownloadList/DownloadList.mjs +5 -5
  20. package/lib/FAQs/FAQs.cjs +6 -6
  21. package/lib/FAQs/FAQs.mjs +6 -6
  22. package/lib/FeaturePost/FeaturePost.cjs +6 -6
  23. package/lib/FeaturePost/FeaturePost.mjs +6 -6
  24. package/lib/HeroLink/HeroLink.cjs +35 -0
  25. package/lib/HeroLink/HeroLink.mjs +33 -0
  26. package/lib/HeroLink/styles.css +1 -0
  27. package/lib/Highlights/Highlights.cjs +9 -16
  28. package/lib/Highlights/Highlights.mjs +7 -14
  29. package/lib/LinkTile/LinkTile.cjs +21 -0
  30. package/lib/LinkTile/LinkTile.mjs +19 -0
  31. package/lib/LinkTile/styles.css +1 -0
  32. package/lib/ProductNavigation/ProductNavigation.cjs +10 -13
  33. package/lib/ProductNavigation/ProductNavigation.mjs +10 -13
  34. package/lib/PromoListing/PromoListing.cjs +17 -9
  35. package/lib/PromoListing/PromoListing.mjs +17 -9
  36. package/lib/Quote/Quote.cjs +3 -3
  37. package/lib/Quote/Quote.mjs +3 -3
  38. package/lib/SectionHeading/SectionHeading.cjs +3 -3
  39. package/lib/SectionHeading/SectionHeading.mjs +3 -3
  40. package/lib/Statistics/Statistics.cjs +6 -6
  41. package/lib/Statistics/Statistics.mjs +6 -6
  42. package/lib/Summary/Summary.cjs +1 -1
  43. package/lib/Summary/Summary.mjs +1 -1
  44. package/lib/_shared/cjs/{Accordion-C4XdbGCu.cjs → Accordion-BCJIm1Gq.cjs} +13 -11
  45. package/lib/_shared/cjs/{Author-X47pv31V.cjs → Author-D4dKNQem.cjs} +2 -2
  46. package/lib/_shared/cjs/BtIconArrowAltRight-CLQdP61r.cjs +11 -0
  47. package/lib/_shared/cjs/BtIconArrowRightFill-BVCZv7Lm.cjs +11 -0
  48. package/lib/_shared/cjs/{SectionHeading-DepTV4JA.cjs → SectionHeading-DeSFM0HV.cjs} +5 -5
  49. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +27 -0
  50. package/lib/_shared/cjs/{index.es-D11PdokQ.cjs → index.es-DzI6hGjj.cjs} +1 -1
  51. package/lib/_shared/esm/{Accordion-Ct7RuUbx.mjs → Accordion-BN_lZk6L.mjs} +13 -11
  52. package/lib/_shared/esm/{Author-CydDYCma.mjs → Author-HnYsFTPT.mjs} +2 -2
  53. package/lib/_shared/esm/BtIconArrowAltRight-VH6RTTnL.mjs +9 -0
  54. package/lib/_shared/esm/BtIconArrowRightFill-D0zKgk3B.mjs +9 -0
  55. package/lib/_shared/esm/{SectionHeading-BayinGP_.mjs → SectionHeading-CpDLCndw.mjs} +5 -5
  56. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +25 -0
  57. package/lib/_shared/esm/{index.es-C4PyYMjI.mjs → index.es-B6Bolkcx.mjs} +1 -1
  58. package/lib/index.cjs +316 -216
  59. package/lib/index.cjs.map +1 -1
  60. package/lib/index.d.cts +155 -26
  61. package/lib/index.d.mts +155 -26
  62. package/lib/index.mjs +314 -217
  63. package/lib/index.mjs.map +1 -1
  64. package/lib/styles.css +1 -1
  65. package/package.json +14 -14
  66. package/src/components/Accordion/Accordion.module.css +6 -0
  67. package/src/components/Accordion/Accordion.tsx +5 -2
  68. package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +2 -2
  69. package/src/components/Accordion/components/AccordionHeading/AccordionHeading.tsx +3 -4
  70. package/src/components/ActionTile/ActionTile.module.css +89 -0
  71. package/src/components/ActionTile/ActionTile.tsx +70 -0
  72. package/src/components/ActionTile/index.ts +1 -0
  73. package/src/components/ArticleSidebar/ArticleSidebar.module.css +6 -0
  74. package/src/components/ArticleSidebar/ArticleSidebar.tsx +115 -85
  75. package/src/components/ArticleSidebar/types/link-section.ts +2 -1
  76. package/src/components/ArticleSidebar/types/share-button.ts +1 -1
  77. package/src/components/ArticleSidebar/types/share.ts +5 -1
  78. package/src/components/ArticleSidebar/types/text-section.ts +3 -2
  79. package/src/components/ArticleSidebar/types/topic.ts +2 -2
  80. package/src/components/Author/Author.tsx +2 -2
  81. package/src/components/BannerWithTabs/BannerWithTabs.tsx +9 -3
  82. package/src/components/CopyLead/CopyLead.tsx +21 -5
  83. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +10 -1
  84. package/src/components/CopyLead/templates/Content/Content.tsx +4 -0
  85. package/src/components/CopyLead/templates/Media/Media.tsx +10 -1
  86. package/src/components/CopyLead/types/copy-lead-button.ts +1 -1
  87. package/src/components/CopyLead/types/copy-lead-image.ts +1 -1
  88. package/src/components/DownloadList/DownloadList.tsx +4 -0
  89. package/src/components/FAQs/FAQs.tsx +7 -3
  90. package/src/components/FeaturePost/FeaturePost.tsx +22 -5
  91. package/src/components/FeaturePost/types/feature-post-app-button-footer.ts +1 -1
  92. package/src/components/FeaturePost/types/feature-post-cta-footer.ts +2 -1
  93. package/src/components/FeaturePost/types/feature-post-image.ts +1 -1
  94. package/src/components/HeroLink/HeroLink.module.css +44 -0
  95. package/src/components/HeroLink/HeroLink.tsx +136 -0
  96. package/src/components/HeroLink/index.ts +2 -0
  97. package/src/components/Highlights/Highlights.tsx +6 -1
  98. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +1 -0
  99. package/src/components/Highlights/types/highlight-link.ts +1 -0
  100. package/src/components/LinkTile/LinkTile.module.css +57 -0
  101. package/src/components/LinkTile/LinkTile.tsx +38 -0
  102. package/src/components/LinkTile/index.ts +1 -0
  103. package/src/components/ProductNavigation/ProductNavigation.tsx +10 -11
  104. package/src/components/ProductNavigation/types/product-list.ts +1 -8
  105. package/src/components/PromoListing/PromoListing.tsx +67 -3
  106. package/src/components/Quote/Quote.tsx +2 -2
  107. package/src/components/SectionHeading/SectionHeading.tsx +17 -7
  108. package/src/components/Statistics/Statistics.tsx +6 -2
  109. package/src/components/index.ts +3 -0
  110. package/versions.json +1 -1
  111. package/lib/_shared/cjs/filter-data-attrs-ajtUvDAC.cjs +0 -15
  112. package/lib/_shared/esm/filter-data-attrs-V7cbJuwS.mjs +0 -13
@@ -1,4 +1,4 @@
1
- import { type HeadingLevel } from "@arc-ui/components/dist/Heading";
1
+ import { type HeadingLevel } from "@arc-ui/components/Heading";
2
2
 
3
3
  export interface Share {
4
4
  heading: string;
@@ -6,4 +6,8 @@ export interface Share {
6
6
  x?: boolean;
7
7
  headingLevel?: HeadingLevel;
8
8
  linkedin?: boolean;
9
+ linkedInAriaLabel?: string;
10
+ xAriaLabel?: string;
11
+ clipboardAriaLabel?: string;
12
+ emailAriaLabel?: string;
9
13
  }
@@ -1,7 +1,8 @@
1
- import { type HeadingLevel } from "@arc-ui/components/dist/Heading";
1
+ import { ReactNode } from "react";
2
+ import { type HeadingLevel } from "@arc-ui/components/Heading";
2
3
 
3
4
  export interface TextSection {
4
5
  heading: string;
5
- content: string;
6
+ content: string | ReactNode;
6
7
  headingLevel?: HeadingLevel;
7
8
  }
@@ -1,5 +1,5 @@
1
- import { type HeadingLevel } from "@arc-ui/components/dist/Heading";
2
- import { type TagProps } from "@arc-ui/components/dist/types/components/Tag/Tag";
1
+ import { type HeadingLevel } from "@arc-ui/components/Heading";
2
+ import { type TagProps } from "@arc-ui/components/Tag";
3
3
 
4
4
  export interface Topic {
5
5
  heading: string;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
3
+ import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
4
4
 
5
5
  import { Grid, GridRow, GridCol } from "@arc-ui/components/Grid";
6
6
  import { type AvatarProps, Avatar } from "@arc-ui/components/Avatar";
@@ -21,7 +21,7 @@ export const Author: React.FC<AuthorProps> = ({
21
21
  const isLargeAvatar = avatar.size === "l" || avatar.size === "xl";
22
22
 
23
23
  return (
24
- <div {...filterDataAttrs(props)}>
24
+ <div {...filterAttrs(props)}>
25
25
  <Grid isFluid isGutterless>
26
26
  <GridRow align="center">
27
27
  <GridCol xs={isLargeAvatar ? 12 : "auto"}>
@@ -2,16 +2,20 @@ import React, { FC } from "react";
2
2
 
3
3
  import classNames from "classnames";
4
4
 
5
- import styles from "./BannerWithTabs.module.css";
6
- import { SectionHeading, SectionHeadingProps } from "../SectionHeading";
7
5
  import { TabbedBanner } from "@arc-ui/components/TabbedBanner";
8
- import { TemplateBannerProps } from "@arc-ui/components/dist/types/components/TemplateBanner/TemplateBanner";
6
+ import { TemplateBannerProps } from "@arc-ui/components/TemplateBanner";
7
+
8
+ import { SectionHeading, SectionHeadingProps } from "../SectionHeading";
9
+
10
+ import styles from "./BannerWithTabs.module.css";
9
11
 
10
12
  export const BannerWithTabs: FC<BannerWithTabsProps> = ({
11
13
  tabs,
12
14
  defaultValue,
13
15
  heading,
14
16
  content,
17
+ id,
18
+ isHeadingWordWrap,
15
19
  alignTypography = "left",
16
20
  minHeight,
17
21
  minHeightM,
@@ -24,6 +28,8 @@ export const BannerWithTabs: FC<BannerWithTabsProps> = ({
24
28
  })}
25
29
  >
26
30
  <SectionHeading
31
+ id={id}
32
+ isHeadingWordWrap={isHeadingWordWrap}
27
33
  heading={heading}
28
34
  content={content}
29
35
  isPadded={alignTypography === "left" ? true : false}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
2
+ import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
3
3
 
4
- import { type HeadingLevel } from "@arc-ui/components/dist/Heading";
5
- import { type VideoPlayerProps } from "@arc-ui/components/dist/VideoPlayer";
4
+ import { type HeadingLevel } from "@arc-ui/components/Heading";
5
+ import { type VideoPlayerProps } from "@arc-ui/components/VideoPlayer";
6
6
 
7
7
  import {
8
8
  type CopyLeadButton,
@@ -19,26 +19,30 @@ import { ContentTemplate } from "./templates/Content";
19
19
  export const CopyLead: React.FC<CopyLeadProps> = ({
20
20
  button,
21
21
  heading,
22
+ id,
22
23
  headingLevel = "2",
23
24
  listItems,
24
25
  video,
25
26
  image,
26
27
  content,
28
+ isHeadingWordWrap,
27
29
  isReverseOrder = false,
28
30
  ...props
29
31
  }) => {
30
32
  if (video || image) {
31
33
  return (
32
34
  <MediaTemplate
35
+ id={id}
33
36
  content={content}
34
37
  video={video}
35
38
  image={image}
36
39
  listItems={listItems}
37
40
  heading={heading}
38
41
  headingLevel={headingLevel}
42
+ isHeadingWordWrap={isHeadingWordWrap}
39
43
  button={button}
40
44
  isReverseOrder={isReverseOrder}
41
- {...filterDataAttrs(props)}
45
+ {...filterAttrs(props)}
42
46
  />
43
47
  );
44
48
  }
@@ -46,12 +50,14 @@ export const CopyLead: React.FC<CopyLeadProps> = ({
46
50
  if (content) {
47
51
  return (
48
52
  <ContentTemplate
53
+ id={id}
49
54
  listItems={listItems}
50
55
  heading={heading}
51
56
  headingLevel={headingLevel}
57
+ isHeadingWordWrap={isHeadingWordWrap}
52
58
  button={button}
53
59
  content={content}
54
- {...filterDataAttrs(props)}
60
+ {...filterAttrs(props)}
55
61
  />
56
62
  );
57
63
  }
@@ -70,6 +76,16 @@ export interface CopyLeadProps {
70
76
  */
71
77
  headingLevel?: HeadingLevel;
72
78
 
79
+ /**
80
+ * id for the heading of `<MediaTemplate />` and `<ContentTemplate />`
81
+ */
82
+ id?: string;
83
+
84
+ /**
85
+ * Word wrap behavior for the heading
86
+ */
87
+ isHeadingWordWrap?: boolean;
88
+
73
89
  /**
74
90
  * 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.
75
91
  */
@@ -12,11 +12,18 @@ import styles from "../../CopyLead.module.css";
12
12
 
13
13
  export const MediaContent: React.FC<MediaContentProps> = ({
14
14
  heading,
15
+ id,
15
16
  headingLevel,
17
+ isHeadingWordWrap,
16
18
  children,
17
19
  }) => (
18
20
  <div className={styles.mediaContainer}>
19
- <ArcHeading level={headingLevel} size="xl">
21
+ <ArcHeading
22
+ id={id}
23
+ level={headingLevel}
24
+ isWordWrap={isHeadingWordWrap}
25
+ size="xl"
26
+ >
20
27
  {heading}
21
28
  </ArcHeading>
22
29
 
@@ -31,6 +38,8 @@ export const MediaContent: React.FC<MediaContentProps> = ({
31
38
 
32
39
  interface MediaContentProps {
33
40
  heading: string;
41
+ id?: string;
34
42
  headingLevel?: HeadingLevel;
43
+ isHeadingWordWrap?: boolean;
35
44
  children?: string | ReactNode;
36
45
  }
@@ -22,8 +22,10 @@ import { getListHeadingLevel } from "../../utils/getListHeadingLevel";
22
22
 
23
23
  export const ContentTemplate: React.FC<ContentTemplateProps> = ({
24
24
  button,
25
+ id,
25
26
  heading,
26
27
  headingLevel,
28
+ isHeadingWordWrap,
27
29
  listItems,
28
30
  content,
29
31
  }) => {
@@ -41,8 +43,10 @@ export const ContentTemplate: React.FC<ContentTemplateProps> = ({
41
43
  <Container type="content" alignment="top">
42
44
  <Column>
43
45
  <SectionHeading
46
+ id={id}
44
47
  heading={heading}
45
48
  headingLevel={headingLevel}
49
+ isHeadingWordWrap={isHeadingWordWrap}
46
50
  content={content}
47
51
  />
48
52
 
@@ -30,12 +30,14 @@ const VideoPlayer = React.lazy(() =>
30
30
 
31
31
  export const MediaTemplate: React.FC<MediaTemplateProps> = ({
32
32
  button,
33
+ id,
33
34
  heading,
34
35
  headingLevel,
35
36
  listItems,
36
37
  video,
37
38
  image,
38
39
  content,
40
+ isHeadingWordWrap,
39
41
  isReverseOrder = false,
40
42
  }) => {
41
43
  const [isClient, setIsClient] = useState(false);
@@ -59,7 +61,12 @@ export const MediaTemplate: React.FC<MediaTemplateProps> = ({
59
61
  {!isMinWidthArcBreakpointXl && (
60
62
  <Columns>
61
63
  <ColumnsCol span={12} spanM={9}>
62
- <MediaContent heading={heading} headingLevel={headingLevel}>
64
+ <MediaContent
65
+ heading={heading}
66
+ headingLevel={headingLevel}
67
+ id={id}
68
+ isHeadingWordWrap={isHeadingWordWrap}
69
+ >
63
70
  {content}
64
71
  </MediaContent>
65
72
  </ColumnsCol>
@@ -99,6 +106,8 @@ export const MediaTemplate: React.FC<MediaTemplateProps> = ({
99
106
  interface MediaTemplateProps {
100
107
  heading: string;
101
108
  headingLevel: HeadingLevel;
109
+ id?: string;
110
+ isHeadingWordWrap?: boolean;
102
111
  listItems: CopyLeadListItem[];
103
112
  content?: string | ReactNode;
104
113
  isReverseOrder?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ButtonProps } from "@arc-ui/components/dist/types/components/Button/Button";
1
+ import { type ButtonProps } from "@arc-ui/components/Button";
2
2
 
3
3
  export type CopyLeadButton = Pick<
4
4
  ButtonProps,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  type ImageSourceProps,
3
3
  type ImageProps as ArcImageProps,
4
- } from "@arc-ui/components/dist/types/components/Image/Image";
4
+ } from "@arc-ui/components/Image";
5
5
 
6
6
  export interface CopyLeadImage
7
7
  extends Pick<
@@ -8,7 +8,9 @@ import styles from "./DownloadList.module.css";
8
8
 
9
9
  export const DownloadList: React.FC<DownloadListProps> = ({
10
10
  heading,
11
+ id,
11
12
  headingLevel = "2",
13
+ isHeadingWordWrap,
12
14
  content,
13
15
  downloads,
14
16
  }) => {
@@ -16,7 +18,9 @@ export const DownloadList: React.FC<DownloadListProps> = ({
16
18
  <>
17
19
  <div className={styles.headingContainer}>
18
20
  <SectionHeading
21
+ id={id}
19
22
  heading={heading}
23
+ isHeadingWordWrap={isHeadingWordWrap}
20
24
  headingLevel={headingLevel}
21
25
  content={content}
22
26
  />
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
- import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
4
+ import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
5
5
 
6
6
  import { Accordion, type AccordionProps } from "../Accordion";
7
7
  import { SectionHeading, type SectionHeadingProps } from "../SectionHeading";
@@ -14,17 +14,21 @@ import styles from "./FAQs.module.css";
14
14
 
15
15
  export const FAQs: React.FC<FAQsProps> = ({
16
16
  heading,
17
+ isHeadingWordWrap,
17
18
  content,
19
+ id,
18
20
  isPadded = false,
19
21
  headingLevel = "2",
20
22
  image,
21
- type = "list",
23
+ type,
22
24
  linkListHeading = "Skip to section",
23
25
  accordionData,
24
26
  ...props
25
27
  }) => (
26
- <div className={styles.FAQs} {...filterDataAttrs(props)}>
28
+ <div className={styles.FAQs} {...filterAttrs(props)}>
27
29
  <SectionHeading
30
+ id={id}
31
+ isHeadingWordWrap={isHeadingWordWrap}
28
32
  heading={heading}
29
33
  content={content}
30
34
  image={image}
@@ -1,8 +1,8 @@
1
- import React from "react";
1
+ import React, { type ReactNode } from "react";
2
2
  import classNames from "classnames";
3
3
  import { isDate, format } from "date-fns";
4
4
 
5
- import { filterDataAttrs } from "@arc-ui/community-utils/filter-data-attrs";
5
+ import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
6
6
 
7
7
  import { ArcSizeBreakpointsM } from "@arc-ui/tokens-arc";
8
8
 
@@ -31,12 +31,14 @@ import { MediaContent } from "./components/MediaContent/MediaContent";
31
31
  * */
32
32
  export const FeaturePost: React.FC<FeaturePostProps> = ({
33
33
  heading,
34
+ id,
34
35
  headingLevel = "2",
35
36
  label,
36
37
  image,
37
38
  content,
38
39
  footer,
39
40
  video,
41
+ isHeadingWordWrap,
40
42
  isReverseOrder = false,
41
43
  ...props
42
44
  }) => {
@@ -50,7 +52,7 @@ export const FeaturePost: React.FC<FeaturePostProps> = ({
50
52
  className={classNames(styles.featurePost, {
51
53
  [styles.featurePostReversed]: isReverseOrder,
52
54
  })}
53
- {...filterDataAttrs(props)}
55
+ {...filterAttrs(props)}
54
56
  >
55
57
  <div className={styles.col}>
56
58
  <div className={styles.contentContainer}>
@@ -82,7 +84,12 @@ export const FeaturePost: React.FC<FeaturePostProps> = ({
82
84
  </Grid>
83
85
  )}
84
86
 
85
- <Heading level={headingLevel} size="xl">
87
+ <Heading
88
+ id={id}
89
+ level={headingLevel}
90
+ isWordWrap={isHeadingWordWrap}
91
+ size="xl"
92
+ >
86
93
  {heading}
87
94
  </Heading>
88
95
 
@@ -165,15 +172,25 @@ export interface FeaturePostProps {
165
172
  */
166
173
  heading: string;
167
174
 
175
+ /**
176
+ * id for `FeaturePost`.
177
+ */
178
+ id?: string;
179
+
168
180
  /**
169
181
  * Determine a heading level for `<FeaturePost />`
170
182
  */
171
183
  headingLevel?: HeadingLevel;
172
184
 
185
+ /**
186
+ * Word wrap behavior for the heading
187
+ */
188
+ isHeadingWordWrap?: boolean;
189
+
173
190
  /**
174
191
  * Text content for `FeaturePost`.
175
192
  */
176
- content: string;
193
+ content: string | ReactNode;
177
194
 
178
195
  /**
179
196
  * 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.
@@ -1,4 +1,4 @@
1
- import { type AppButtonProps } from "@arc-ui/components/dist/types/components/AppButton";
1
+ import { type AppButtonProps } from "@arc-ui/components/AppButton";
2
2
 
3
3
  export interface FeaturePostAppButtonFooter {
4
4
  type: "appButton";
@@ -1,4 +1,5 @@
1
- import { type ButtonProps } from "@arc-ui/components/dist/types/components/Button/Button";
1
+ import { type ButtonProps } from "@arc-ui/components/Button";
2
+
2
3
  import { type AuthorProps } from "../../Author/Author";
3
4
 
4
5
  export interface FeaturePostCtaFooter {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  type ImageSourceProps,
3
3
  type ImageProps as ArcImageProps,
4
- } from "@arc-ui/components/dist/types/components/Image/Image";
4
+ } from "@arc-ui/components/Image";
5
5
 
6
6
  export interface FeaturePostImage
7
7
  extends Pick<
@@ -0,0 +1,44 @@
1
+ .heroLink {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 4px;
6
+ padding: 16px 16px 16px 24px;
7
+ border: 2px solid #e5e5e5;
8
+ border-radius: 32px;
9
+ background: transparent;
10
+ color: #5514b4;
11
+ text-decoration: none;
12
+ font-size: 14px;
13
+ font-weight: 500;
14
+ line-height: 1;
15
+ cursor: pointer;
16
+ transition: all 0.2s ease;
17
+ width: fit-content;
18
+ height: fit-content;
19
+ }
20
+
21
+ .heroLink:hover {
22
+ border-color: #3f187f;
23
+ color: #3f187f;
24
+ }
25
+
26
+ .heroLink-inner {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 4px;
30
+ }
31
+
32
+ .heroLink-label {
33
+ white-space: nowrap;
34
+ }
35
+
36
+ .heroLink-icon {
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ }
41
+
42
+ .heroLink--emptyLabel {
43
+ padding: 16px;
44
+ }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { HeroLink } from "./HeroLink";
2
+ export type { HeroLinkProps } from "./HeroLink";
@@ -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.
@@ -48,6 +48,7 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
48
48
  <Link
49
49
  href={link.url}
50
50
  id={link.url}
51
+ aria-label={link.ariaLabel}
51
52
  onClick={link.onClick}
52
53
  rel=""
53
54
  size="m"
@@ -1,5 +1,6 @@
1
1
  export interface HighlightLink {
2
2
  url: string;
3
3
  textLink: string;
4
+ ariaLabel?: string;
4
5
  onClick?: (e: React.MouseEvent) => void;
5
6
  }