@arc-ui/community-components 3.3.0 → 3.5.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 (142) hide show
  1. package/.turbo/turbo-build.log +135 -15
  2. package/CHANGELOG.md +22 -0
  3. package/lib/Accordion/Accordion.cjs +3 -2
  4. package/lib/Accordion/Accordion.mjs +3 -2
  5. package/lib/ActionTile/ActionTile.cjs +7 -5
  6. package/lib/ActionTile/ActionTile.mjs +13 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +10 -9
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -45
  10. package/lib/Author/Author.cjs +3 -2
  11. package/lib/Author/Author.mjs +3 -2
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +5 -4
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -7
  14. package/lib/BusinessSegmentSwitcher/BusinessSegmentSwitcher.cjs +81 -0
  15. package/lib/BusinessSegmentSwitcher/BusinessSegmentSwitcher.mjs +79 -0
  16. package/lib/BusinessSegmentSwitcher/styles.css +1 -0
  17. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +4 -3
  18. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  19. package/lib/CopyLead/CopyLead.cjs +33 -22
  20. package/lib/CopyLead/CopyLead.mjs +61 -50
  21. package/lib/DownloadList/DownloadList.cjs +6 -5
  22. package/lib/DownloadList/DownloadList.mjs +11 -10
  23. package/lib/FAQs/FAQs.cjs +6 -5
  24. package/lib/FAQs/FAQs.mjs +23 -22
  25. package/lib/FeaturePost/FeaturePost.cjs +13 -12
  26. package/lib/FeaturePost/FeaturePost.mjs +55 -54
  27. package/lib/Highlights/Highlights.cjs +11 -10
  28. package/lib/Highlights/Highlights.mjs +21 -20
  29. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +4 -3
  30. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +12 -11
  31. package/lib/LinkTile/LinkTile.cjs +3 -3
  32. package/lib/LinkTile/LinkTile.mjs +6 -6
  33. package/lib/LinkTile/styles.css +1 -1
  34. package/lib/ProductNavigation/ProductNavigation.cjs +7 -6
  35. package/lib/ProductNavigation/ProductNavigation.mjs +19 -18
  36. package/lib/PromoListing/PromoListing.cjs +8 -7
  37. package/lib/PromoListing/PromoListing.mjs +17 -16
  38. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +8 -7
  39. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +10 -9
  40. package/lib/Quote/Quote.cjs +6 -5
  41. package/lib/Quote/Quote.mjs +10 -9
  42. package/lib/SectionHeading/SectionHeading.cjs +3 -2
  43. package/lib/SectionHeading/SectionHeading.mjs +3 -2
  44. package/lib/Statistics/Statistics.cjs +6 -5
  45. package/lib/Statistics/Statistics.mjs +33 -32
  46. package/lib/Summary/Summary.cjs +5 -4
  47. package/lib/Summary/Summary.mjs +13 -12
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +3 -2
  49. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +3 -2
  50. package/lib/VideoHeroCard/VideoHeroCard.cjs +77 -0
  51. package/lib/VideoHeroCard/VideoHeroCard.mjs +75 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +23 -0
  53. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +21 -0
  54. package/lib/_shared/cjs/{Accordion-QqDoB3pY.cjs → Accordion-DfNGOjTm.cjs} +9 -8
  55. package/lib/_shared/cjs/{Author-aL8YXi7C.cjs → Author-D4dKNQem.cjs} +5 -4
  56. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  57. package/lib/_shared/cjs/{SectionHeading-Dj-dJfv3.cjs → SectionHeading-DeSFM0HV.cjs} +5 -4
  58. package/lib/_shared/cjs/{ThumbnailSignpost-SBnrGooA.cjs → ThumbnailSignpost-GkOiwt-Z.cjs} +5 -4
  59. package/lib/_shared/cjs/VideoCardThumbnail-N5iC-cAU.cjs +441 -0
  60. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  61. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +27 -0
  62. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  63. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  64. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  65. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  66. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  67. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  68. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  69. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  70. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  71. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  72. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  73. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  74. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  75. package/lib/_shared/cjs/{filter-attrs-C26zOt4_.cjs → tslib.es6-BxB9I209.cjs} +0 -25
  76. package/lib/_shared/esm/{Accordion-DrOTh90S.mjs → Accordion-DSRlkcXi.mjs} +17 -16
  77. package/lib/_shared/esm/Author-CLMgH9ES.mjs +28 -0
  78. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  79. package/lib/_shared/esm/{SectionHeading-DZOg_gYi.mjs → SectionHeading-DSwsdNSp.mjs} +11 -10
  80. package/lib/_shared/esm/{ThumbnailSignpost-DaZByYIH.mjs → ThumbnailSignpost-BtaHAB0h.mjs} +14 -13
  81. package/lib/_shared/esm/VideoCardThumbnail-Tbh7Xi-X.mjs +438 -0
  82. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  83. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +25 -0
  84. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  85. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  86. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  87. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  88. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  89. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  90. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  91. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  92. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  93. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  94. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  95. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  96. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  97. package/lib/_shared/esm/{filter-attrs-D-1kWaCP.mjs → tslib.es6-BVXMhEem.mjs} +1 -25
  98. package/lib/index.cjs +323 -125
  99. package/lib/index.cjs.map +1 -1
  100. package/lib/index.d.cts +114 -3
  101. package/lib/index.d.mts +114 -3
  102. package/lib/index.mjs +321 -126
  103. package/lib/index.mjs.map +1 -1
  104. package/lib/styles.css +1 -1
  105. package/package.json +16 -13
  106. package/rollup.config.js +1 -1
  107. package/src/components/ActionTile/ActionTile.module.css +1 -0
  108. package/src/components/ActionTile/ActionTile.tsx +11 -3
  109. package/src/components/BusinessSegmentSwitcher/BusinessSegmentSwitcher.module.css +92 -0
  110. package/src/components/BusinessSegmentSwitcher/BusinessSegmentSwitcher.tsx +119 -0
  111. package/src/components/BusinessSegmentSwitcher/helpers/renderBusinessSegmentSwitcherCarousel.tsx +45 -0
  112. package/src/components/BusinessSegmentSwitcher/helpers/renderCard.tsx +17 -0
  113. package/src/components/BusinessSegmentSwitcher/index.ts +9 -0
  114. package/src/components/BusinessSegmentSwitcher/types/types.ts +45 -0
  115. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  116. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  117. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  118. package/src/components/LinkTile/LinkTile.module.css +8 -4
  119. package/src/components/LinkTile/LinkTile.tsx +1 -2
  120. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  121. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  122. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  123. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  124. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  125. package/src/components/VideoHeroCard/index.ts +1 -0
  126. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  127. package/src/components/VideoPortraitCard/index.ts +4 -0
  128. package/src/components/index.ts +3 -0
  129. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  130. package/src/internal/MultiLineText/index.ts +1 -0
  131. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  132. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  133. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  134. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  135. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  136. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  137. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  138. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/index.ts +2 -0
  140. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  141. package/versions.json +1 -1
  142. package/lib/_shared/esm/Author-BVCRPgkl.mjs +0 -27
@@ -1,4 +1,4 @@
1
- import React, { Suspense, useEffect, useState, ReactNode } from "react";
1
+ import React, { Suspense, useEffect, useState } from "react";
2
2
 
3
3
  import { ArcSizeBreakpointsL, ArcSizeBreakpointsXl } from "@arc-ui/tokens-arc";
4
4
 
@@ -66,9 +66,8 @@ export const MediaTemplate: React.FC<MediaTemplateProps> = ({
66
66
  headingLevel={headingLevel}
67
67
  id={id}
68
68
  isHeadingWordWrap={isHeadingWordWrap}
69
- >
70
- {content}
71
- </MediaContent>
69
+ content={content}
70
+ />
72
71
  </ColumnsCol>
73
72
  </Columns>
74
73
  )}
@@ -79,7 +78,7 @@ export const MediaTemplate: React.FC<MediaTemplateProps> = ({
79
78
  >
80
79
  <Column>
81
80
  {isMinWidthArcBreakpointXl && (
82
- <MediaContent heading={heading}>{content}</MediaContent>
81
+ <MediaContent heading={heading} content={content} />
83
82
  )}
84
83
 
85
84
  <IconList
@@ -109,7 +108,7 @@ interface MediaTemplateProps {
109
108
  id?: string;
110
109
  isHeadingWordWrap?: boolean;
111
110
  listItems: CopyLeadListItem[];
112
- content?: string | ReactNode;
111
+ content?: string;
113
112
  isReverseOrder?: boolean;
114
113
  button?: CopyLeadButton;
115
114
  image?: CopyLeadImage;
@@ -6,8 +6,11 @@
6
6
  flex-direction: column;
7
7
  justify-content: center;
8
8
  align-items: center;
9
- width: 306px;
10
- height: 96px;
9
+ width: 100%;
10
+ max-width: 306px;
11
+ height: 144px;
12
+ min-height: 144px;
13
+ max-height: 144px;
11
14
  border: var(--sem-border-width-xxs) solid
12
15
  var(--sem-color-border-secondary-light-minimal);
13
16
  border-radius: var(--sem-border-radius-xl);
@@ -20,7 +23,8 @@
20
23
  flex: none;
21
24
  align-self: stretch;
22
25
  position: relative;
23
- overflow: visible;
26
+ overflow: hidden;
27
+ flex-grow: 1;
24
28
  }
25
29
 
26
30
  .link-tile-content {
@@ -30,7 +34,7 @@
30
34
  align-items: center;
31
35
  gap: var(--sem-space-padding-40);
32
36
  width: 100%;
33
- height: 48px;
37
+ min-height: 48px;
34
38
  flex: none;
35
39
  align-self: stretch;
36
40
  }
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import classNames from "classnames";
3
3
  import styles from "./LinkTile.module.css";
4
- import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
5
4
  import { Icon } from "@arc-ui/components/Icon";
6
5
  import { BtIconArrowAltRight } from "@arc-ui/icons/BtIconArrowAltRight";
7
6
 
@@ -19,7 +18,7 @@ export const LinkTile: React.FC<LinkTileProps> = ({
19
18
  <Component
20
19
  className={classNames(styles["link-tile"], className)}
21
20
  {...linkProps}
22
- {...filterAttrs(props)}
21
+ {...(props as React.HTMLAttributes<HTMLElement>)}
23
22
  >
24
23
  {text && (
25
24
  <div className={styles["link-tile-content"]}>
@@ -22,6 +22,7 @@ export const PromoListingThumbnailSignpost: React.FC<
22
22
  content,
23
23
  headingLevel,
24
24
  thumbnailList,
25
+ isHeadingWordWrap,
25
26
  ...props
26
27
  }) => {
27
28
  return (
@@ -35,6 +36,7 @@ export const PromoListingThumbnailSignpost: React.FC<
35
36
  heading={heading}
36
37
  headingLevel={headingLevel}
37
38
  content={content}
39
+ isHeadingWordWrap={isHeadingWordWrap}
38
40
  />
39
41
  <ul className={styles.list}>
40
42
  {thumbnailList.map((thumbnail, index) => (
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+
3
+ import { Visible } from "@arc-ui/components/Visible";
4
+ import { Spacing } from "@arc-ui/components/Spacing";
5
+
6
+ import {
7
+ VideoCardPlayer,
8
+ VideoCardPlayerProps,
9
+ VideoCardThumbnail,
10
+ } from "../../internal/VideoCardPlayer";
11
+
12
+ import {
13
+ VideoHeroCardContent,
14
+ VideoHeroCardContentProps,
15
+ } from "./components/VideoHeroCardContent";
16
+
17
+ export const VideoHeroCard = ({
18
+ content,
19
+ thumbnailImg,
20
+ player,
21
+ ...props
22
+ }: VideoHeroCardProps) => {
23
+ return (
24
+ <VideoCardPlayer
25
+ thumbnail={
26
+ <VideoCardThumbnail
27
+ src={thumbnailImg}
28
+ orientation="landscape"
29
+ contentVisibility={{ l: true, xl: true, xxl: true }}
30
+ >
31
+ <VideoHeroCardContent {...content} background="dark" />
32
+ </VideoCardThumbnail>
33
+ }
34
+ orientation="landscape"
35
+ playIconSize="l"
36
+ player={player}
37
+ {...props}
38
+ >
39
+ {content && (
40
+ <Visible xs s m>
41
+ <Spacing all={{ xs: "16", s: "32" }}>
42
+ <VideoHeroCardContent {...content} background="light" />
43
+ </Spacing>
44
+ </Visible>
45
+ )}
46
+ </VideoCardPlayer>
47
+ );
48
+ };
49
+
50
+ export interface VideoHeroCardProps {
51
+ /**
52
+ * Content for the video card.
53
+ */
54
+ content: Omit<VideoHeroCardContentProps, "background">;
55
+ /**
56
+ * Thumbnail for the video hero card.
57
+ */
58
+ thumbnailImg: string;
59
+ /**
60
+ * Configuration for the video player.
61
+ */
62
+ player: VideoCardPlayerProps["player"];
63
+ }
@@ -0,0 +1,32 @@
1
+ @import url("@arc-ui/tokens-arc/dist/custom-media.css");
2
+
3
+ .mainText--lightBackground {
4
+ color: var(--sem-color-fg-secondary-dark-alt);
5
+ }
6
+
7
+ .statContainer--lightBackground {
8
+ color: var(--sem-color-fg-secondary-light-default);
9
+ }
10
+
11
+ .statContainer--darkBackground,
12
+ .mainText--darkBackground {
13
+ color: var(--sem-color-fg-primary-dark-default);
14
+ }
15
+
16
+ .statContainer {
17
+ align-items: flex-start;
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ gap: var(--sem-space-gap-40);
21
+ }
22
+
23
+ .stat {
24
+ align-items: center;
25
+ display: flex;
26
+ gap: var(--sem-space-gap-5);
27
+ white-space: nowrap;
28
+ }
29
+
30
+ .stat:not(:last-of-type) {
31
+ padding-right: var(--sem-space-padding-110);
32
+ }
@@ -0,0 +1,97 @@
1
+ import React, { ReactNode, useId } from "react";
2
+
3
+ import { BtIconCalendar } from "@arc-ui/icons/BtIconCalendar";
4
+ import { BtIconClock } from "@arc-ui/icons/BtIconClock";
5
+ import { BtIconChatMessage } from "@arc-ui/icons/BtIconChatMessage";
6
+
7
+ import { Heading } from "@arc-ui/components/Heading";
8
+ import { Icon } from "@arc-ui/components/Icon";
9
+ import { Text } from "@arc-ui/components/Text";
10
+ import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
11
+
12
+ import styles from "./VideoHeroCardContent.module.css";
13
+ import classNames from "classnames";
14
+
15
+ export const VideoHeroCardContent = ({
16
+ title,
17
+ label,
18
+ description,
19
+ videoDate,
20
+ duration,
21
+ background,
22
+ subtitleAvailabilityText,
23
+ }: VideoHeroCardContentProps) => {
24
+ const id = useId();
25
+
26
+ const metaItems: MetaItem[] = [
27
+ { icon: BtIconCalendar, text: videoDate },
28
+ { icon: BtIconClock, text: duration },
29
+ {
30
+ icon: BtIconChatMessage,
31
+ text: subtitleAvailabilityText,
32
+ },
33
+ ];
34
+
35
+ const hasMeta = metaItems.some((meta) => Boolean(meta.text));
36
+
37
+ return (
38
+ <div className={styles[`${background}Background`]}>
39
+ <div
40
+ className={classNames(
41
+ styles.mainText,
42
+ styles[`mainText--${background}Background`],
43
+ )}
44
+ >
45
+ <Heading fontStyle="overline">{label}</Heading>
46
+
47
+ <VerticalSpace size="8" sizeM="4" />
48
+
49
+ <Heading level="3" isWordWrap={false} size="xl">
50
+ {title}
51
+ </Heading>
52
+
53
+ <VerticalSpace size="16" />
54
+
55
+ <Text>{description}</Text>
56
+ </div>
57
+
58
+ {hasMeta && (
59
+ <>
60
+ <VerticalSpace size="32" sizeS="16" />
61
+
62
+ <div
63
+ className={classNames(
64
+ styles.statContainer,
65
+ styles[`statContainer--${background}Background`],
66
+ )}
67
+ >
68
+ {metaItems.map(
69
+ (meta, i) =>
70
+ meta.text && (
71
+ <div key={`${id}-stat-${i}`} className={styles.stat}>
72
+ <Icon icon={meta.icon} size={20} />
73
+ <Text size="xs">{meta.text}</Text>
74
+ </div>
75
+ ),
76
+ )}
77
+ </div>
78
+ </>
79
+ )}
80
+ </div>
81
+ );
82
+ };
83
+
84
+ type MetaItem = {
85
+ text?: string;
86
+ icon: string;
87
+ };
88
+
89
+ export interface VideoHeroCardContentProps {
90
+ title: string;
91
+ label: string;
92
+ description: string | ReactNode;
93
+ background: "dark" | "light";
94
+ videoDate?: string;
95
+ duration?: string;
96
+ subtitleAvailabilityText?: string;
97
+ }
@@ -0,0 +1,4 @@
1
+ export {
2
+ VideoHeroCardContent,
3
+ type VideoHeroCardContentProps,
4
+ } from "./VideoHeroCardContent";
@@ -0,0 +1 @@
1
+ export { VideoHeroCard, type VideoHeroCardProps } from "./VideoHeroCard";
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+
3
+ import { Heading } from "@arc-ui/components/Heading";
4
+ import { Surface } from "@arc-ui/components/Surface";
5
+ import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
6
+
7
+ import {
8
+ VideoCardPlayer,
9
+ VideoCardPlayerProps,
10
+ VideoCardThumbnail,
11
+ } from "../../internal/VideoCardPlayer";
12
+
13
+ export const VideoPortraitCard = ({
14
+ thumbnail,
15
+ player,
16
+ ...props
17
+ }: VideoPortraitCardProps) => {
18
+ return (
19
+ <VideoCardPlayer
20
+ thumbnail={
21
+ thumbnail && (
22
+ <VideoCardThumbnail orientation="portrait" src={thumbnail.img}>
23
+ <Surface isTransparent background="dark-black">
24
+ <Heading fontStyle="overline">{thumbnail.label}</Heading>
25
+ <VerticalSpace size="8" />
26
+ <Heading level="3" isWordWrap={false} size="xs">
27
+ {thumbnail.title}
28
+ </Heading>
29
+ </Surface>
30
+ </VideoCardThumbnail>
31
+ )
32
+ }
33
+ orientation="portrait"
34
+ player={player}
35
+ playIconSize="s"
36
+ {...props}
37
+ />
38
+ );
39
+ };
40
+
41
+ export interface VideoPortraitCardProps {
42
+ /**
43
+ * Thumbnail content, video will autoplay if omitted.
44
+ */
45
+ thumbnail?: {
46
+ title: string;
47
+ label: string;
48
+ img: string;
49
+ };
50
+ /**
51
+ * Configuration for the video player.
52
+ */
53
+ player: VideoCardPlayerProps["player"];
54
+ }
@@ -0,0 +1,4 @@
1
+ export {
2
+ VideoPortraitCard,
3
+ type VideoPortraitCardProps,
4
+ } from "./VideoPortraitCard";
@@ -19,3 +19,6 @@ export * from "./LinkTile";
19
19
  export * from "./InlineLinkGroup";
20
20
  export * from "./ThumbnailSignpost";
21
21
  export * from "./PromoListingThumbnailSignpost";
22
+ export * from "./VideoHeroCard";
23
+ export * from "./VideoPortraitCard";
24
+ export * from "./BusinessSegmentSwitcher";
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+
3
+ import { Text, TextProps } from "@arc-ui/components/Text";
4
+ import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
5
+
6
+ export const MultiLineText = ({ text, ...textProps }: MultiLineTextProps) => {
7
+ if (!text) return null;
8
+
9
+ const paragraphs = text.split(/\\n|\n/).filter((p) => p.trim());
10
+
11
+ return (
12
+ <>
13
+ {paragraphs.map((paragraph, index) => (
14
+ <span key={`informationcard-text-${index}`}>
15
+ {index > 0 && <VerticalSpace size="8" />}
16
+ <Text {...textProps}>{paragraph}</Text>
17
+ </span>
18
+ ))}
19
+ </>
20
+ );
21
+ };
22
+
23
+ interface MultiLineTextProps extends Partial<TextProps> {
24
+ text?: string;
25
+ }
@@ -0,0 +1 @@
1
+ export { MultiLineText } from "./MultiLineText";
@@ -0,0 +1,54 @@
1
+ /* stylelint-disable selector-pseudo-class-no-unknown */
2
+ .container {
3
+ border-radius: var(--sem-border-radius-s);
4
+ border: var(--sem-border-width-xs) solid
5
+ var(--sem-color-border-secondary-light-subtle);
6
+ outline: var(--sem-border-width-l) solid transparent;
7
+ transition:
8
+ 0.4s ease outline-color,
9
+ 0.4s ease box-shadow;
10
+ overflow: hidden;
11
+ }
12
+
13
+ .container iframe {
14
+ border: none;
15
+ height: 100%;
16
+ width: 100%;
17
+ }
18
+
19
+ .container :global(.react-player__preview) {
20
+ position: relative;
21
+ }
22
+
23
+ .player {
24
+ height: 100%;
25
+ width: 100%;
26
+ }
27
+
28
+ .playerWrapper {
29
+ width: 100%;
30
+ position: relative;
31
+ }
32
+
33
+ .playerWrapper--landscape {
34
+ aspect-ratio: 16 / 9;
35
+ }
36
+
37
+ .playerWrapper--portrait {
38
+ aspect-ratio: 9 / 16;
39
+ }
40
+
41
+ .container:has(:global(.react-player__preview):focus) {
42
+ outline-color: var(--sem-color-border-primary-light-default);
43
+ }
44
+
45
+ .container:has(:global(.react-player__preview):hover),
46
+ .container:has(:global(.react-player__preview):focus) {
47
+ box-shadow: var(--elevation-05);
48
+ }
49
+
50
+ @media (--arc-custom-media-min-width-l-px) {
51
+ .container {
52
+ border: none;
53
+ }
54
+ }
@@ -0,0 +1,62 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import classNames from "classnames";
3
+
4
+ import ReactPlayer from "react-player";
5
+ import { ReactPlayerProps } from "react-player/types";
6
+
7
+ import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
8
+
9
+ import { VideoCardPlayIcon } from "./components/VideoCardPlayIcon";
10
+ import { PlayerProps } from "./types/player-props";
11
+
12
+ import styles from "./VideoCardPlayer.module.css";
13
+
14
+ export const VideoCardPlayer = ({
15
+ thumbnail,
16
+ playIconSize,
17
+ orientation,
18
+ children,
19
+ player,
20
+ ...props
21
+ }: VideoCardPlayerProps) => {
22
+ const [isClient, setIsClient] = useState<boolean>(false);
23
+
24
+ useEffect(() => {
25
+ setIsClient(true);
26
+ }, []);
27
+
28
+ const playerProps = {
29
+ ...player,
30
+ light: thumbnail,
31
+ playIcon: <VideoCardPlayIcon size={playIconSize} />,
32
+ muted: !thumbnail,
33
+ playing: true,
34
+ controls: true,
35
+ className: styles.player,
36
+ width: "100%",
37
+ height: "100%",
38
+ };
39
+
40
+ return (
41
+ <div className={styles.container} {...filterAttrs(props)}>
42
+ <div
43
+ data-testid="arc-video-card"
44
+ className={classNames(
45
+ styles.playerWrapper,
46
+ styles[`playerWrapper--${orientation}`],
47
+ )}
48
+ >
49
+ {isClient && <ReactPlayer {...playerProps} />}
50
+ </div>
51
+ {children}
52
+ </div>
53
+ );
54
+ };
55
+
56
+ export interface VideoCardPlayerProps {
57
+ player: PlayerProps;
58
+ orientation: "portrait" | "landscape";
59
+ playIconSize: "s" | "l";
60
+ thumbnail?: ReactPlayerProps["light"];
61
+ children?: React.ReactNode;
62
+ }
@@ -0,0 +1,41 @@
1
+ /* stylelint-disable selector-pseudo-class-no-unknown */
2
+ .playIconContainer {
3
+ background: var(--sem-color-bg-primary-dark-default);
4
+ position: relative;
5
+ z-index: 1;
6
+ transition: 0.4s ease background-color;
7
+ border-radius: var(--sem-border-radius-s);
8
+ }
9
+
10
+ .playIconContainer--s {
11
+ width: 44px;
12
+ height: 44px;
13
+ position: absolute;
14
+ right: var(--sem-space-gap-110);
15
+ top: var(--sem-space-gap-110);
16
+ }
17
+
18
+ .playIconContainer--l {
19
+ height: 64px;
20
+ width: 64px;
21
+ }
22
+
23
+ .playIcon {
24
+ color: var(--sem-color-fg-secondary-light-default);
25
+ height: 100%;
26
+ width: 100%;
27
+ transition: 0.4s ease color;
28
+ }
29
+
30
+ :global(.react-player__preview):hover .playIconContainer {
31
+ background: var(--sem-color-bg-primary-light-subtle);
32
+ }
33
+
34
+ :global(.react-player__preview):focus .playIconContainer {
35
+ background: var(--sem-color-bg-primary-light-default);
36
+ }
37
+
38
+ :global(.react-player__preview):focus .playIcon,
39
+ :global(.react-player__preview):hover .playIcon {
40
+ color: var(--sem-color-fg-primary-dark-default);
41
+ }
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+
3
+ import classNames from "classnames";
4
+
5
+ import { Icon } from "@arc-ui/components/Icon";
6
+
7
+ import { ArcIconPlay } from "@arc-ui/icons/ArcIconPlay";
8
+
9
+ import styles from "./VideoCardPlayIcon.module.css";
10
+
11
+ export const VideoCardPlayIcon = ({ size = "l" }: VideoCardPlayIconProps) => {
12
+ return (
13
+ <div
14
+ className={classNames(
15
+ styles.playIconContainer,
16
+ styles[`playIconContainer--${size}`],
17
+ )}
18
+ >
19
+ <div className={styles.playIcon}>
20
+ <Icon icon={ArcIconPlay} />
21
+ </div>
22
+ </div>
23
+ );
24
+ };
25
+
26
+ interface VideoCardPlayIconProps {
27
+ size?: "s" | "l";
28
+ }
@@ -0,0 +1 @@
1
+ export { VideoCardPlayIcon } from "./VideoCardPlayIcon";
@@ -0,0 +1,58 @@
1
+ @import url("@arc-ui/tokens-arc/dist/custom-media.css");
2
+
3
+ .thumbnail {
4
+ align-items: flex-end;
5
+ background-size: cover;
6
+ bottom: 0;
7
+ display: flex;
8
+ left: 0;
9
+ overflow: hidden;
10
+ position: absolute;
11
+ right: 0;
12
+ top: 0;
13
+ cursor: pointer;
14
+ }
15
+
16
+ .thumbnail::before {
17
+ bottom: 0;
18
+ content: "";
19
+ display: block;
20
+ left: 0;
21
+ position: absolute;
22
+ right: 0;
23
+ top: 0;
24
+ }
25
+
26
+ .thumbnail--landscape::before {
27
+ background: linear-gradient(
28
+ 180deg,
29
+ rgba(42, 42, 42, 0%) 0%,
30
+ rgba(42, 42, 42, 62%) 51.92%,
31
+ var(--sem-color-bg-secondary-light-alt) 100%
32
+ );
33
+ }
34
+
35
+ .thumbnail--portrait::before {
36
+ background: linear-gradient(
37
+ 0deg,
38
+ var(--sem-color-bg-secondary-light-alt) 0.01%,
39
+ rgba(42, 42, 42, 90%) 16.31%,
40
+ rgba(42, 42, 42, 81%) 26.66%,
41
+ rgba(42, 42, 42, 0%) 100%
42
+ );
43
+ }
44
+
45
+ .thumbnailContent {
46
+ position: relative;
47
+ padding: var(--sem-space-padding-130);
48
+ }
49
+
50
+ .thumbnail--portrait .thumbnailContent {
51
+ padding: var(--sem-space-padding-110);
52
+ }
53
+
54
+ @media (--arc-custom-media-min-width-xl-px) {
55
+ .thumbnailContent {
56
+ padding: var(--sem-space-padding-160);
57
+ }
58
+ }
@@ -0,0 +1,38 @@
1
+ import classNames from "classnames";
2
+ import React from "react";
3
+
4
+ import { Visible, VisibleProps } from "@arc-ui/components/Visible";
5
+
6
+ import styles from "./VideoCardThumbnail.module.css";
7
+
8
+ export const VideoCardThumbnail = ({
9
+ orientation,
10
+ contentVisibility,
11
+ src,
12
+ children,
13
+ }: VideoCardThumbnailProps) => {
14
+ const content = <div className={styles.thumbnailContent}>{children}</div>;
15
+
16
+ return (
17
+ <div
18
+ className={classNames(
19
+ styles.thumbnail,
20
+ styles[`thumbnail--${orientation}`],
21
+ )}
22
+ style={{ backgroundImage: `url(${src})` }}
23
+ >
24
+ {contentVisibility ? (
25
+ <Visible {...contentVisibility}>{content}</Visible>
26
+ ) : (
27
+ content
28
+ )}
29
+ </div>
30
+ );
31
+ };
32
+
33
+ interface VideoCardThumbnailProps {
34
+ src: string;
35
+ children: React.ReactNode;
36
+ orientation: "portrait" | "landscape";
37
+ contentVisibility?: Omit<VisibleProps, "children">;
38
+ }