@arc-ui/community-components 3.2.0 → 3.4.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 (158) hide show
  1. package/.turbo/turbo-build.log +133 -13
  2. package/CHANGELOG.md +31 -0
  3. package/lib/Accordion/Accordion.cjs +2 -3
  4. package/lib/Accordion/Accordion.mjs +2 -3
  5. package/lib/ActionTile/ActionTile.cjs +4 -5
  6. package/lib/ActionTile/ActionTile.mjs +10 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -47
  10. package/lib/Author/Author.cjs +2 -3
  11. package/lib/Author/Author.mjs +2 -3
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -9
  14. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
  15. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  16. package/lib/CopyLead/CopyLead.cjs +32 -23
  17. package/lib/CopyLead/CopyLead.mjs +60 -51
  18. package/lib/DownloadList/DownloadList.cjs +6 -8
  19. package/lib/DownloadList/DownloadList.mjs +11 -13
  20. package/lib/FAQs/FAQs.cjs +5 -6
  21. package/lib/FAQs/FAQs.mjs +22 -23
  22. package/lib/FeaturePost/FeaturePost.cjs +14 -15
  23. package/lib/FeaturePost/FeaturePost.mjs +54 -55
  24. package/lib/Highlights/Highlights.cjs +11 -12
  25. package/lib/Highlights/Highlights.mjs +24 -25
  26. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
  27. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
  28. package/lib/InlineLinkGroup/styles.css +1 -0
  29. package/lib/LinkTile/LinkTile.cjs +6 -6
  30. package/lib/LinkTile/LinkTile.mjs +7 -7
  31. package/lib/LinkTile/styles.css +1 -1
  32. package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
  33. package/lib/ProductNavigation/ProductNavigation.mjs +18 -19
  34. package/lib/PromoListing/PromoListing.cjs +7 -8
  35. package/lib/PromoListing/PromoListing.mjs +17 -18
  36. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +7 -8
  37. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +9 -10
  38. package/lib/Quote/Quote.cjs +5 -6
  39. package/lib/Quote/Quote.mjs +9 -10
  40. package/lib/SectionHeading/SectionHeading.cjs +2 -3
  41. package/lib/SectionHeading/SectionHeading.mjs +2 -3
  42. package/lib/Statistics/Statistics.cjs +21 -19
  43. package/lib/Statistics/Statistics.mjs +35 -33
  44. package/lib/Statistics/styles.css +1 -1
  45. package/lib/Summary/Summary.cjs +4 -4
  46. package/lib/Summary/Summary.mjs +13 -13
  47. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +2 -3
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +2 -3
  49. package/lib/VideoHeroCard/VideoHeroCard.cjs +76 -0
  50. package/lib/VideoHeroCard/VideoHeroCard.mjs +74 -0
  51. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +22 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +20 -0
  53. package/lib/_shared/cjs/{Accordion-DfNGOjTm.cjs → Accordion-QqDoB3pY.cjs} +8 -9
  54. package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
  55. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  56. package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
  57. package/lib/_shared/cjs/{ThumbnailSignpost-GkOiwt-Z.cjs → ThumbnailSignpost-SBnrGooA.cjs} +4 -5
  58. package/lib/_shared/cjs/VideoCardThumbnail-BqYgpk0u.cjs +440 -0
  59. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  60. package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
  61. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  62. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  63. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  64. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  65. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  66. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  67. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  68. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  69. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  70. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  71. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  72. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  73. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  74. package/lib/_shared/esm/{Accordion-cd1oYvBv.mjs → Accordion-DtU7jbCv.mjs} +16 -17
  75. package/lib/_shared/esm/Author-CJQFrQM9.mjs +27 -0
  76. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  77. package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-BskdQ2Tt.mjs} +10 -11
  78. package/lib/_shared/esm/{ThumbnailSignpost-BeRiXbUp.mjs → ThumbnailSignpost-CBSdQiHw.mjs} +13 -14
  79. package/lib/_shared/esm/VideoCardThumbnail-VfOKmPCv.mjs +437 -0
  80. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  81. package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
  82. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  83. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  84. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  85. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  86. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  87. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  88. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  89. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  90. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  91. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  92. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  93. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  94. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  95. package/lib/index.cjs +299 -181
  96. package/lib/index.cjs.map +1 -1
  97. package/lib/index.d.cts +77 -63
  98. package/lib/index.d.mts +77 -63
  99. package/lib/index.mjs +297 -181
  100. package/lib/index.mjs.map +1 -1
  101. package/lib/styles.css +1 -1
  102. package/package.json +15 -12
  103. package/rollup.config.js +1 -1
  104. package/src/components/ActionTile/ActionTile.module.css +56 -37
  105. package/src/components/ActionTile/ActionTile.tsx +1 -1
  106. package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
  107. package/src/components/Author/Author.tsx +0 -3
  108. package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
  109. package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
  110. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  111. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  112. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  113. package/src/components/DownloadList/DownloadList.tsx +8 -8
  114. package/src/components/FeaturePost/FeaturePost.tsx +3 -7
  115. package/src/components/Highlights/Highlights.tsx +3 -2
  116. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
  117. package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
  118. package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
  119. package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
  120. package/src/components/InlineLinkGroup/index.ts +5 -0
  121. package/src/components/LinkTile/LinkTile.module.css +62 -26
  122. package/src/components/LinkTile/LinkTile.tsx +8 -1
  123. package/src/components/PromoListing/PromoListing.tsx +3 -11
  124. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  125. package/src/components/Quote/Quote.tsx +1 -7
  126. package/src/components/Statistics/Statistics.module.css +0 -10
  127. package/src/components/Statistics/Statistics.tsx +35 -32
  128. package/src/components/Summary/Summary.tsx +3 -1
  129. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  130. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  131. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  132. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  133. package/src/components/VideoHeroCard/index.ts +1 -0
  134. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  135. package/src/components/VideoPortraitCard/index.ts +4 -0
  136. package/src/components/index.ts +3 -1
  137. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  138. package/src/internal/MultiLineText/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  140. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  141. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  142. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  143. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  144. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  145. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  146. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  147. package/src/internal/VideoCardPlayer/index.ts +2 -0
  148. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  149. package/versions.json +1 -1
  150. package/lib/HeroLink/HeroLink.cjs +0 -35
  151. package/lib/HeroLink/HeroLink.mjs +0 -33
  152. package/lib/HeroLink/styles.css +0 -1
  153. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
  154. package/lib/_shared/esm/Author-HnYsFTPT.mjs +0 -28
  155. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
  156. package/src/components/HeroLink/HeroLink.module.css +0 -44
  157. package/src/components/HeroLink/HeroLink.tsx +0 -136
  158. package/src/components/HeroLink/index.ts +0 -2
@@ -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";
@@ -14,8 +14,10 @@ export * from "./ArticleSidebar";
14
14
  export * from "./ProductNavigation";
15
15
  export * from "./SectionHeading";
16
16
  export * from "./ContentInfoWidget";
17
- export * from "./HeroLink";
18
17
  export * from "./ActionTile";
19
18
  export * from "./LinkTile";
19
+ export * from "./InlineLinkGroup";
20
20
  export * from "./ThumbnailSignpost";
21
21
  export * from "./PromoListingThumbnailSignpost";
22
+ export * from "./VideoHeroCard";
23
+ export * from "./VideoPortraitCard";
@@ -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
+ }
@@ -0,0 +1 @@
1
+ export { VideoCardThumbnail } from "./VideoCardThumbnail";
@@ -0,0 +1,2 @@
1
+ export { VideoCardPlayer, type VideoCardPlayerProps } from "./VideoCardPlayer";
2
+ export { VideoCardThumbnail } from "./components/VideoCardThumbnail";
@@ -0,0 +1,6 @@
1
+ import { ReactPlayerProps } from "react-player/types";
2
+
3
+ export type PlayerProps = Pick<
4
+ ReactPlayerProps,
5
+ "onReady" | "onPlay" | "onStart" | "onPause" | "onEnded" | "onError" | "src"
6
+ >;
package/versions.json CHANGED
@@ -1 +1 @@
1
- ["v3.2.0","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
+ ["v3.4.0","v3.3.0","v3.2.0","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,35 +0,0 @@
1
- 'use strict';
2
-
3
- var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
4
- var React = require('react');
5
- var index = require('../_shared/cjs/index-Bp6Dd2i1.cjs');
6
- var BtIconArrowAltRight = require('../_shared/cjs/BtIconArrowAltRight-CLQdP61r.cjs');
7
- var Icon = require('@arc-ui/components/Icon');
8
-
9
- var styles = {"heroLink":"HeroLink-module_heroLink__WUqWB","heroLink-inner":"HeroLink-module_heroLink-inner__RE5i8","heroLink-label":"HeroLink-module_heroLink-label__93HPY","heroLink-icon":"HeroLink-module_heroLink-icon__l7o4U","heroLink--emptyLabel":"HeroLink-module_heroLink--emptyLabel__XY2sa"};
10
-
11
- /**
12
- * Pill-style HeroLink component with default and hover states
13
- */
14
- var HeroLink = function (_a) {
15
- var _b;
16
- var label = _a.label, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, ariaLabel = _a.ariaLabel, ref = _a.ref, props = tslib_es6.__rest(_a, ["label", "onClick", "href", "id", "rel", "target", "ariaLabel", "ref"]);
17
- var HeroLinkClasses = index.classNames(styles.heroLink, (_b = {},
18
- _b[styles["heroLink--emptyLabel"]] = !label,
19
- _b));
20
- var commonProps = tslib_es6.__assign({ id: id, onClick: onClick, ref: ref }, props);
21
- if (href) {
22
- return (React.createElement("a", tslib_es6.__assign({}, commonProps, { className: HeroLinkClasses, href: href, rel: rel, "aria-label": ariaLabel, target: target }),
23
- React.createElement("span", { className: styles["heroLink-inner"] },
24
- label && React.createElement("span", { className: styles["heroLink-label"] }, label),
25
- React.createElement("span", { className: styles["heroLink-icon"] },
26
- React.createElement(Icon.Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight.BtIconArrowAltRight })))));
27
- }
28
- return (React.createElement("button", tslib_es6.__assign({}, commonProps, { className: HeroLinkClasses, "aria-label": ariaLabel }),
29
- React.createElement("span", { className: styles["heroLink-inner"] },
30
- label && React.createElement("span", { className: styles["heroLink-label"] }, label),
31
- React.createElement("span", { className: styles["heroLink-icon"] },
32
- React.createElement(Icon.Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight.BtIconArrowAltRight })))));
33
- };
34
-
35
- exports.HeroLink = HeroLink;
@@ -1,33 +0,0 @@
1
- import { a as __rest, _ as __assign } from '../_shared/esm/tslib.es6-D6Wu-xwB.mjs';
2
- import React from 'react';
3
- import { c as classNames } from '../_shared/esm/index-BfTCfPZ1.mjs';
4
- import { B as BtIconArrowAltRight } from '../_shared/esm/BtIconArrowAltRight-VH6RTTnL.mjs';
5
- import { Icon } from '@arc-ui/components/Icon';
6
-
7
- var styles = {"heroLink":"HeroLink-module_heroLink__WUqWB","heroLink-inner":"HeroLink-module_heroLink-inner__RE5i8","heroLink-label":"HeroLink-module_heroLink-label__93HPY","heroLink-icon":"HeroLink-module_heroLink-icon__l7o4U","heroLink--emptyLabel":"HeroLink-module_heroLink--emptyLabel__XY2sa"};
8
-
9
- /**
10
- * Pill-style HeroLink component with default and hover states
11
- */
12
- var HeroLink = function (_a) {
13
- var _b;
14
- var label = _a.label, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, ariaLabel = _a.ariaLabel, ref = _a.ref, props = __rest(_a, ["label", "onClick", "href", "id", "rel", "target", "ariaLabel", "ref"]);
15
- var HeroLinkClasses = classNames(styles.heroLink, (_b = {},
16
- _b[styles["heroLink--emptyLabel"]] = !label,
17
- _b));
18
- var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, props);
19
- if (href) {
20
- return (React.createElement("a", __assign({}, commonProps, { className: HeroLinkClasses, href: href, rel: rel, "aria-label": ariaLabel, target: target }),
21
- React.createElement("span", { className: styles["heroLink-inner"] },
22
- label && React.createElement("span", { className: styles["heroLink-label"] }, label),
23
- React.createElement("span", { className: styles["heroLink-icon"] },
24
- React.createElement(Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight })))));
25
- }
26
- return (React.createElement("button", __assign({}, commonProps, { className: HeroLinkClasses, "aria-label": ariaLabel }),
27
- React.createElement("span", { className: styles["heroLink-inner"] },
28
- label && React.createElement("span", { className: styles["heroLink-label"] }, label),
29
- React.createElement("span", { className: styles["heroLink-icon"] },
30
- React.createElement(Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight })))));
31
- };
32
-
33
- export { HeroLink };
@@ -1 +0,0 @@
1
- .HeroLink-module_heroLink__WUqWB{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:16px 16px 16px 24px;border:2px solid #e5e5e5;border-radius:32px;background:transparent;color:#5514b4;text-decoration:none;font-size:14px;font-weight:500;line-height:1;cursor:pointer;transition:all 0.2s ease;width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}.HeroLink-module_heroLink__WUqWB:hover{border-color:#3f187f;color:#3f187f}.HeroLink-module_heroLink-inner__RE5i8{display:flex;align-items:center;gap:4px}.HeroLink-module_heroLink-label__93HPY{white-space:nowrap}.HeroLink-module_heroLink-icon__l7o4U{display:flex;align-items:center;justify-content:center}.HeroLink-module_heroLink--emptyLabel__XY2sa{padding:16px}
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Filters out attributes from the given props object based on a pattern.
5
- *
6
- * This function extracts all properties that match either the `data-*` or `aria-*` attribute patterns
7
- * and returns a new object containing only those properties.
8
- *
9
- * @param props - The object containing properties to filter.
10
- * @returns A new object containing only the matched attributes (`data-*` and `aria-*`) from the input props.
11
- */
12
- var attributePrefixes = ["data-", "aria-"];
13
- var filterAttrs = function (props) {
14
- var filteredProps = {};
15
- var _loop_1 = function (prop) {
16
- if (Object.prototype.hasOwnProperty.call(props, prop) &&
17
- attributePrefixes.some(function (prefix) { return prop.startsWith(prefix); })) {
18
- filteredProps[prop] = props[prop];
19
- }
20
- };
21
- for (var prop in props) {
22
- _loop_1(prop);
23
- }
24
- return filteredProps;
25
- };
26
-
27
- exports.filterAttrs = filterAttrs;