@arc-ui/community-components 3.13.0 → 3.14.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 +18 -16
- package/CHANGELOG.md +18 -0
- package/lib/ArticleCarousel/ArticleCarousel.cjs +1 -1
- package/lib/ArticleCarousel/ArticleCarousel.mjs +1 -1
- package/lib/ArticleSidebar/ArticleSidebar.cjs +15 -9
- package/lib/ArticleSidebar/ArticleSidebar.mjs +16 -10
- package/lib/CopyLead/CopyLead.cjs +1 -1
- package/lib/CopyLead/CopyLead.mjs +1 -1
- package/lib/FeaturePost/FeaturePost.cjs +1 -1
- package/lib/FeaturePost/FeaturePost.mjs +1 -1
- package/lib/InlineLinkGroup/InlineLinkGroup.cjs +2 -2
- package/lib/InlineLinkGroup/InlineLinkGroup.mjs +2 -2
- package/lib/ProductCard/ProductCard.cjs +77 -0
- package/lib/ProductCard/ProductCard.mjs +72 -0
- package/lib/ProductCard/styles.css +1 -0
- package/lib/ProductCardGrid/ProductCardGrid.cjs +69 -0
- package/lib/ProductCardGrid/ProductCardGrid.mjs +67 -0
- package/lib/ProductNavigation/ProductNavigation.cjs +1 -1
- package/lib/ProductNavigation/ProductNavigation.mjs +1 -1
- package/lib/PromoListing/PromoListing.cjs +1 -1
- package/lib/PromoListing/PromoListing.mjs +1 -1
- package/lib/Summary/Summary.cjs +1 -1
- package/lib/Summary/Summary.mjs +1 -1
- package/lib/VideoHeroCard/VideoHeroCard.cjs +4 -4
- package/lib/VideoHeroCard/VideoHeroCard.mjs +4 -4
- package/lib/VideoPortraitCard/VideoPortraitCard.cjs +3 -3
- package/lib/VideoPortraitCard/VideoPortraitCard.mjs +3 -3
- package/lib/_shared/cjs/{VideoCardThumbnail-BM3GwyWR.cjs → VideoCardThumbnail-DhdbNf5c.cjs} +10 -2
- package/lib/_shared/cjs/{index.es-DcJ01c8P.cjs → index.es-5qmN4ppJ.cjs} +1 -1
- package/lib/_shared/esm/{VideoCardThumbnail-K6eHIeAM.mjs → VideoCardThumbnail-B8JS-s6O.mjs} +10 -2
- package/lib/_shared/esm/{index.es-C76rXaZz.mjs → index.es-Cis5MKaa.mjs} +1 -1
- package/lib/index.cjs +309 -180
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +75 -2
- package/lib/index.d.mts +75 -2
- package/lib/index.mjs +306 -182
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +14 -14
- package/src/components/ArticleSidebar/ArticleSidebar.tsx +24 -10
- package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +4 -0
- package/src/components/ProductCard/ProductCard.module.css +49 -0
- package/src/components/ProductCard/ProductCard.tsx +113 -0
- package/src/components/ProductCard/ProductCardBenefits/ProductCardBenefits.module.css +14 -0
- package/src/components/ProductCard/ProductCardBenefits/ProductCardBenefits.tsx +42 -0
- package/src/components/ProductCard/ProductCardBenefits/index.ts +4 -0
- package/src/components/ProductCard/ProductCardPrice/ProductCardPrice.module.css +5 -0
- package/src/components/ProductCard/ProductCardPrice/ProductCardPrice.tsx +37 -0
- package/src/components/ProductCard/ProductCardPrice/index.ts +4 -0
- package/src/components/ProductCard/ProductCardPriceIncrease/ProductCardPriceIncrease.module.css +25 -0
- package/src/components/ProductCard/ProductCardPriceIncrease/ProductCardPriceIncrease.tsx +39 -0
- package/src/components/ProductCard/ProductCardPriceIncrease/index.ts +4 -0
- package/src/components/ProductCard/index.ts +13 -0
- package/src/components/ProductCardGrid/ProductCardGrid.tsx +162 -0
- package/src/components/ProductCardGrid/components/CardGrid/CardGrid.module.css +34 -0
- package/src/components/ProductCardGrid/components/CardGrid/CardGrid.tsx +44 -0
- package/src/components/ProductCardGrid/components/CardGrid/index.ts +1 -0
- package/src/components/ProductCardGrid/index.ts +5 -0
- package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +9 -3
- package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +11 -3
- package/src/components/index.ts +2 -0
- package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +5 -2
- package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +16 -1
- package/versions.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mjs';
|
|
2
|
+
import React__default, { useState, useRef, useId } from 'react';
|
|
3
|
+
import { f as filterAttrs } from '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
4
|
+
import { S as SectionHeading } from '../_shared/esm/SectionHeading-lyXLUtdr.mjs';
|
|
5
|
+
import { Tabs, TabsList, TabsItem, TabsContent } from '@arc-ui/components/Tabs';
|
|
6
|
+
import { VerticalSpace } from '@arc-ui/components/VerticalSpace';
|
|
7
|
+
import { ButtonV2 } from '@arc-ui/components/ButtonV2';
|
|
8
|
+
import { Rule } from '@arc-ui/components/Rule';
|
|
9
|
+
import { Align } from '@arc-ui/components/Align';
|
|
10
|
+
import '../_shared/esm/index-BSO2EFem.mjs';
|
|
11
|
+
import '@arc-ui/components/Text';
|
|
12
|
+
import '@arc-ui/components/Image';
|
|
13
|
+
import '@arc-ui/components/Heading';
|
|
14
|
+
import '@arc-ui/components/Columns';
|
|
15
|
+
|
|
16
|
+
var styles = {"cardGrid":"CardGrid-module_cardGrid__b6S6h","cardGridItem":"CardGrid-module_cardGridItem__xy0D3"};
|
|
17
|
+
|
|
18
|
+
var CardGrid = function (_a) {
|
|
19
|
+
var cards = _a.cards, cardsRevealed = _a.cardsRevealed, fourthCardRef = _a.fourthCardRef, props = __rest(_a, ["cards", "cardsRevealed", "fourthCardRef"]);
|
|
20
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
21
|
+
React__default.createElement("ul", __assign({ className: styles.cardGrid }, filterAttrs(props)), (cardsRevealed ? cards : cards.slice(0, 3)).map(function (card, index) { return (React__default.createElement("li", { key: "card-".concat(index), className: styles.cardGridItem, ref: index === 3 ? fourthCardRef : undefined, tabIndex: -1 }, card)); })),
|
|
22
|
+
React__default.createElement(VerticalSpace, { size: "24", sizeXL: "32" })));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var ProductCardGrid = function (_a) {
|
|
26
|
+
var _b, _c, _d, _e, _f;
|
|
27
|
+
var id = _a.id, isHeadingWordWrap = _a.isHeadingWordWrap, heading = _a.heading, content = _a.content, headingLevel = _a.headingLevel, tabs = _a.tabs, _g = _a.expanded, expanded = _g === void 0 ? true : _g, _h = _a.hideTabs, hideTabs = _h === void 0 ? false : _h, props = __rest(_a, ["id", "isHeadingWordWrap", "heading", "content", "headingLevel", "tabs", "expanded", "hideTabs"]);
|
|
28
|
+
var _j = useState(expanded), cardsRevealed = _j[0], setCardsRevealed = _j[1];
|
|
29
|
+
var _k = useState((_b = tabs === null || tabs === void 0 ? void 0 : tabs[0]) === null || _b === void 0 ? void 0 : _b.value), activeTab = _k[0], setActiveTab = _k[1];
|
|
30
|
+
var fourthCardRef = useRef(null);
|
|
31
|
+
var cardContext = useId();
|
|
32
|
+
var activeCards = (_c = tabs === null || tabs === void 0 ? void 0 : tabs.find(function (tab) { return tab.value === activeTab; })) === null || _c === void 0 ? void 0 : _c.cards;
|
|
33
|
+
var hasMoreCards = ((_d = activeCards === null || activeCards === void 0 ? void 0 : activeCards.length) !== null && _d !== void 0 ? _d : 0) > 3;
|
|
34
|
+
var remainingCards = Math.max(((_e = activeCards === null || activeCards === void 0 ? void 0 : activeCards.length) !== null && _e !== void 0 ? _e : 0) - 3, 0);
|
|
35
|
+
var showMore = function () {
|
|
36
|
+
setCardsRevealed(true);
|
|
37
|
+
setTimeout(function () {
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = fourthCardRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
40
|
+
}, 0);
|
|
41
|
+
};
|
|
42
|
+
var showLess = function () {
|
|
43
|
+
setCardsRevealed(false);
|
|
44
|
+
};
|
|
45
|
+
return (React__default.createElement("div", __assign({}, filterAttrs(props)),
|
|
46
|
+
React__default.createElement(SectionHeading, { id: id, isHeadingWordWrap: isHeadingWordWrap, heading: heading, content: content, headingLevel: headingLevel, isPadded: true }),
|
|
47
|
+
tabs && !hideTabs && (React__default.createElement(Tabs, { defaultValue: (_f = tabs[0]) === null || _f === void 0 ? void 0 : _f.value, onValueChange: function (value) {
|
|
48
|
+
setActiveTab(value);
|
|
49
|
+
} },
|
|
50
|
+
React__default.createElement(TabsList, { type: "standard" }, tabs.map(function (tab) { return (React__default.createElement(TabsItem, { key: tab.value, label: tab.label, value: tab.value, icon: tab.icon, iconActive: tab.iconActive })); })),
|
|
51
|
+
tabs.map(function (tab) { return (React__default.createElement(TabsContent, { key: tab.value, value: tab.value },
|
|
52
|
+
React__default.createElement(VerticalSpace, { size: "24", sizeL: "32" }),
|
|
53
|
+
React__default.createElement(CardGrid, { cards: tab.cards, cardsRevealed: cardsRevealed, fourthCardRef: tab.value === activeTab ? fourthCardRef : { current: null } }))); }))),
|
|
54
|
+
(tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 && hideTabs && (React__default.createElement(React__default.Fragment, null,
|
|
55
|
+
React__default.createElement(CardGrid, { cards: tabs[0].cards, cardsRevealed: cardsRevealed, fourthCardRef: fourthCardRef }))),
|
|
56
|
+
!expanded && hasMoreCards && (React__default.createElement(React__default.Fragment, null,
|
|
57
|
+
React__default.createElement(Rule, null),
|
|
58
|
+
React__default.createElement("span", { id: cardContext, style: { display: "none" } }, remainingCards === 1
|
|
59
|
+
? "".concat(remainingCards, " card")
|
|
60
|
+
: "".concat(remainingCards, " cards")),
|
|
61
|
+
React__default.createElement(Align, { horizontal: "center" },
|
|
62
|
+
React__default.createElement(VerticalSpace, { size: "16" }),
|
|
63
|
+
!cardsRevealed && (React__default.createElement(ButtonV2, { label: "Show more", buttonStyle: "secondary", onClick: showMore, "aria-describedby": cardContext })),
|
|
64
|
+
cardsRevealed && (React__default.createElement(ButtonV2, { label: "Show less", buttonStyle: "secondary", onClick: showLess, "aria-describedby": cardContext })))))));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { ProductCardGrid };
|
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var index = require('../_shared/cjs/index-B7Z7sgRq.cjs');
|
|
6
6
|
var filterAttrs = require('../_shared/cjs/filter-attrs-BizjMsy0.cjs');
|
|
7
7
|
var useMediaQuery = require('@arc-ui/components/use-media-query');
|
|
8
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
8
|
+
var index_es = require('../_shared/cjs/index.es-5qmN4ppJ.cjs');
|
|
9
9
|
var SectionHeading = require('../_shared/cjs/SectionHeading-XCMdv8eZ.cjs');
|
|
10
10
|
var ButtonV2 = require('@arc-ui/components/ButtonV2');
|
|
11
11
|
var InformationCard = require('@arc-ui/components/InformationCard');
|
|
@@ -3,7 +3,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
|
3
3
|
import { c as classNames } from '../_shared/esm/index-BSO2EFem.mjs';
|
|
4
4
|
import { f as filterAttrs } from '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
5
5
|
import { useMediaQuery } from '@arc-ui/components/use-media-query';
|
|
6
|
-
import { A as ArcSizeBreakpointsS } from '../_shared/esm/index.es-
|
|
6
|
+
import { A as ArcSizeBreakpointsS } from '../_shared/esm/index.es-Cis5MKaa.mjs';
|
|
7
7
|
import { S as SectionHeading } from '../_shared/esm/SectionHeading-lyXLUtdr.mjs';
|
|
8
8
|
import { ButtonV2 } from '@arc-ui/components/ButtonV2';
|
|
9
9
|
import { InformationCard } from '@arc-ui/components/InformationCard';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('../_shared/cjs/index-B7Z7sgRq.cjs');
|
|
6
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
6
|
+
var index_es = require('../_shared/cjs/index.es-5qmN4ppJ.cjs');
|
|
7
7
|
var Carousel = require('@arc-ui/components/Carousel');
|
|
8
8
|
var Heading = require('@arc-ui/components/Heading');
|
|
9
9
|
var useMediaQuery = require('@arc-ui/components/use-media-query');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mjs';
|
|
2
2
|
import React__default, { useId } from 'react';
|
|
3
3
|
import { c as classNames } from '../_shared/esm/index-BSO2EFem.mjs';
|
|
4
|
-
import { a as ArcSizeBreakpointsL, b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-
|
|
4
|
+
import { a as ArcSizeBreakpointsL, b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-Cis5MKaa.mjs';
|
|
5
5
|
import { Carousel } from '@arc-ui/components/Carousel';
|
|
6
6
|
import { Heading } from '@arc-ui/components/Heading';
|
|
7
7
|
import { useMediaQuery } from '@arc-ui/components/use-media-query';
|
package/lib/Summary/Summary.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
5
|
+
var index_es = require('../_shared/cjs/index.es-5qmN4ppJ.cjs');
|
|
6
6
|
var Heading = require('@arc-ui/components/Heading');
|
|
7
7
|
var Text = require('@arc-ui/components/Text');
|
|
8
8
|
var Box = require('@arc-ui/components/Box');
|
package/lib/Summary/Summary.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mjs';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-
|
|
3
|
+
import { b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-Cis5MKaa.mjs';
|
|
4
4
|
import { Heading } from '@arc-ui/components/Heading';
|
|
5
5
|
import { Text } from '@arc-ui/components/Text';
|
|
6
6
|
import { Box } from '@arc-ui/components/Box';
|
|
@@ -4,7 +4,7 @@ var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var Visible = require('@arc-ui/components/Visible');
|
|
6
6
|
var Spacing = require('@arc-ui/components/Spacing');
|
|
7
|
-
var VideoCardThumbnail = require('../_shared/cjs/VideoCardThumbnail-
|
|
7
|
+
var VideoCardThumbnail = require('../_shared/cjs/VideoCardThumbnail-DhdbNf5c.cjs');
|
|
8
8
|
var Heading = require('@arc-ui/components/Heading');
|
|
9
9
|
var Icon = require('@arc-ui/components/Icon');
|
|
10
10
|
var Text = require('@arc-ui/components/Text');
|
|
@@ -39,7 +39,7 @@ const BtIconClock =
|
|
|
39
39
|
var styles = {"mainText--lightBackground":"VideoHeroCardContent-module_mainText--lightBackground__nGl6W","statContainer--lightBackground":"VideoHeroCardContent-module_statContainer--lightBackground__7hXAf","statContainer--darkBackground":"VideoHeroCardContent-module_statContainer--darkBackground__X3-r2","mainText--darkBackground":"VideoHeroCardContent-module_mainText--darkBackground__Pfizt","statContainer":"VideoHeroCardContent-module_statContainer__q21g9","stat":"VideoHeroCardContent-module_stat__iIcoq"};
|
|
40
40
|
|
|
41
41
|
var VideoHeroCardContent = function (_a) {
|
|
42
|
-
var title = _a.title, label = _a.label, description = _a.description, videoDate = _a.videoDate, duration = _a.duration, background = _a.background, subtitleAvailabilityText = _a.subtitleAvailabilityText;
|
|
42
|
+
var title = _a.title, label = _a.label, _b = _a.titleLevel, titleLevel = _b === void 0 ? "3" : _b, labelLevel = _a.labelLevel, description = _a.description, videoDate = _a.videoDate, duration = _a.duration, background = _a.background, subtitleAvailabilityText = _a.subtitleAvailabilityText;
|
|
43
43
|
var id = React.useId();
|
|
44
44
|
var metaItems = [
|
|
45
45
|
{ icon: BtIconCalendar, text: videoDate },
|
|
@@ -52,9 +52,9 @@ var VideoHeroCardContent = function (_a) {
|
|
|
52
52
|
var hasMeta = metaItems.some(function (meta) { return Boolean(meta.text); });
|
|
53
53
|
return (React.createElement("div", { className: styles["".concat(background, "Background")] },
|
|
54
54
|
React.createElement("div", { className: index.classNames(styles.mainText, styles["mainText--".concat(background, "Background")]) },
|
|
55
|
-
React.createElement(Heading.Heading, { fontStyle: "overline" }, label),
|
|
55
|
+
React.createElement(Heading.Heading, { level: labelLevel, fontStyle: "overline" }, label),
|
|
56
56
|
React.createElement(VerticalSpace.VerticalSpace, { size: "8", sizeM: "4" }),
|
|
57
|
-
React.createElement(Heading.Heading, { level:
|
|
57
|
+
React.createElement(Heading.Heading, { level: titleLevel, isWordWrap: false, size: "xl" }, title),
|
|
58
58
|
React.createElement(VerticalSpace.VerticalSpace, { size: "16" }),
|
|
59
59
|
React.createElement(Text.Text, null, description)),
|
|
60
60
|
hasMeta && (React.createElement(React.Fragment, null,
|
|
@@ -2,7 +2,7 @@ import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mj
|
|
|
2
2
|
import React__default, { useId } from 'react';
|
|
3
3
|
import { Visible } from '@arc-ui/components/Visible';
|
|
4
4
|
import { Spacing } from '@arc-ui/components/Spacing';
|
|
5
|
-
import { V as VideoCardPlayer, a as VideoCardThumbnail } from '../_shared/esm/VideoCardThumbnail-
|
|
5
|
+
import { V as VideoCardPlayer, a as VideoCardThumbnail } from '../_shared/esm/VideoCardThumbnail-B8JS-s6O.mjs';
|
|
6
6
|
import { Heading } from '@arc-ui/components/Heading';
|
|
7
7
|
import { Icon } from '@arc-ui/components/Icon';
|
|
8
8
|
import { Text } from '@arc-ui/components/Text';
|
|
@@ -37,7 +37,7 @@ const BtIconClock =
|
|
|
37
37
|
var styles = {"mainText--lightBackground":"VideoHeroCardContent-module_mainText--lightBackground__nGl6W","statContainer--lightBackground":"VideoHeroCardContent-module_statContainer--lightBackground__7hXAf","statContainer--darkBackground":"VideoHeroCardContent-module_statContainer--darkBackground__X3-r2","mainText--darkBackground":"VideoHeroCardContent-module_mainText--darkBackground__Pfizt","statContainer":"VideoHeroCardContent-module_statContainer__q21g9","stat":"VideoHeroCardContent-module_stat__iIcoq"};
|
|
38
38
|
|
|
39
39
|
var VideoHeroCardContent = function (_a) {
|
|
40
|
-
var title = _a.title, label = _a.label, description = _a.description, videoDate = _a.videoDate, duration = _a.duration, background = _a.background, subtitleAvailabilityText = _a.subtitleAvailabilityText;
|
|
40
|
+
var title = _a.title, label = _a.label, _b = _a.titleLevel, titleLevel = _b === void 0 ? "3" : _b, labelLevel = _a.labelLevel, description = _a.description, videoDate = _a.videoDate, duration = _a.duration, background = _a.background, subtitleAvailabilityText = _a.subtitleAvailabilityText;
|
|
41
41
|
var id = useId();
|
|
42
42
|
var metaItems = [
|
|
43
43
|
{ icon: BtIconCalendar, text: videoDate },
|
|
@@ -50,9 +50,9 @@ var VideoHeroCardContent = function (_a) {
|
|
|
50
50
|
var hasMeta = metaItems.some(function (meta) { return Boolean(meta.text); });
|
|
51
51
|
return (React__default.createElement("div", { className: styles["".concat(background, "Background")] },
|
|
52
52
|
React__default.createElement("div", { className: classNames(styles.mainText, styles["mainText--".concat(background, "Background")]) },
|
|
53
|
-
React__default.createElement(Heading, { fontStyle: "overline" }, label),
|
|
53
|
+
React__default.createElement(Heading, { level: labelLevel, fontStyle: "overline" }, label),
|
|
54
54
|
React__default.createElement(VerticalSpace, { size: "8", sizeM: "4" }),
|
|
55
|
-
React__default.createElement(Heading, { level:
|
|
55
|
+
React__default.createElement(Heading, { level: titleLevel, isWordWrap: false, size: "xl" }, title),
|
|
56
56
|
React__default.createElement(VerticalSpace, { size: "16" }),
|
|
57
57
|
React__default.createElement(Text, null, description)),
|
|
58
58
|
hasMeta && (React__default.createElement(React__default.Fragment, null,
|
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var Heading = require('@arc-ui/components/Heading');
|
|
6
6
|
var Surface = require('@arc-ui/components/Surface');
|
|
7
7
|
var VerticalSpace = require('@arc-ui/components/VerticalSpace');
|
|
8
|
-
var VideoCardThumbnail = require('../_shared/cjs/VideoCardThumbnail-
|
|
8
|
+
var VideoCardThumbnail = require('../_shared/cjs/VideoCardThumbnail-DhdbNf5c.cjs');
|
|
9
9
|
require('../_shared/cjs/index-B7Z7sgRq.cjs');
|
|
10
10
|
require('../_shared/cjs/filter-attrs-BizjMsy0.cjs');
|
|
11
11
|
require('@arc-ui/components/Icon');
|
|
@@ -15,9 +15,9 @@ var VideoPortraitCard = function (_a) {
|
|
|
15
15
|
var thumbnail = _a.thumbnail, player = _a.player, props = tslib_es6.__rest(_a, ["thumbnail", "player"]);
|
|
16
16
|
return (React.createElement(VideoCardThumbnail.VideoCardPlayer, tslib_es6.__assign({ thumbnail: thumbnail && (React.createElement(VideoCardThumbnail.VideoCardThumbnail, { orientation: "portrait", src: thumbnail.img },
|
|
17
17
|
React.createElement(Surface.Surface, { isTransparent: true, background: "dark-black" },
|
|
18
|
-
React.createElement(Heading.Heading, { fontStyle: "overline" }, thumbnail.label),
|
|
18
|
+
React.createElement(Heading.Heading, { fontStyle: "overline", level: thumbnail.labelLevel }, thumbnail.label),
|
|
19
19
|
React.createElement(VerticalSpace.VerticalSpace, { size: "8" }),
|
|
20
|
-
React.createElement(Heading.Heading, { level:
|
|
20
|
+
React.createElement(Heading.Heading, { level: thumbnail.titleLevel, isWordWrap: false, size: "xs" }, thumbnail.title)))), orientation: "portrait", player: player, playIconSize: "s" }, props)));
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
exports.VideoPortraitCard = VideoPortraitCard;
|
|
@@ -3,7 +3,7 @@ import React__default from 'react';
|
|
|
3
3
|
import { Heading } from '@arc-ui/components/Heading';
|
|
4
4
|
import { Surface } from '@arc-ui/components/Surface';
|
|
5
5
|
import { VerticalSpace } from '@arc-ui/components/VerticalSpace';
|
|
6
|
-
import { V as VideoCardPlayer, a as VideoCardThumbnail } from '../_shared/esm/VideoCardThumbnail-
|
|
6
|
+
import { V as VideoCardPlayer, a as VideoCardThumbnail } from '../_shared/esm/VideoCardThumbnail-B8JS-s6O.mjs';
|
|
7
7
|
import '../_shared/esm/index-BSO2EFem.mjs';
|
|
8
8
|
import '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
9
9
|
import '@arc-ui/components/Icon';
|
|
@@ -13,9 +13,9 @@ var VideoPortraitCard = function (_a) {
|
|
|
13
13
|
var thumbnail = _a.thumbnail, player = _a.player, props = __rest(_a, ["thumbnail", "player"]);
|
|
14
14
|
return (React__default.createElement(VideoCardPlayer, __assign({ thumbnail: thumbnail && (React__default.createElement(VideoCardThumbnail, { orientation: "portrait", src: thumbnail.img },
|
|
15
15
|
React__default.createElement(Surface, { isTransparent: true, background: "dark-black" },
|
|
16
|
-
React__default.createElement(Heading, { fontStyle: "overline" }, thumbnail.label),
|
|
16
|
+
React__default.createElement(Heading, { fontStyle: "overline", level: thumbnail.labelLevel }, thumbnail.label),
|
|
17
17
|
React__default.createElement(VerticalSpace, { size: "8" }),
|
|
18
|
-
React__default.createElement(Heading, { level:
|
|
18
|
+
React__default.createElement(Heading, { level: thumbnail.titleLevel, isWordWrap: false, size: "xs" }, thumbnail.title)))), orientation: "portrait", player: player, playIconSize: "s" }, props)));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { VideoPortraitCard };
|
|
@@ -421,12 +421,20 @@ var styles$1 = {"container":"VideoCardPlayer-module_container__G-Uta","player":"
|
|
|
421
421
|
var VideoCardPlayer = function (_a) {
|
|
422
422
|
var thumbnail = _a.thumbnail, playIconSize = _a.playIconSize, orientation = _a.orientation, children = _a.children, player = _a.player, props = tslib_es6.__rest(_a, ["thumbnail", "playIconSize", "orientation", "children", "player"]);
|
|
423
423
|
var _b = React.useState(false), isClient = _b[0], setIsClient = _b[1];
|
|
424
|
+
var playerWrapperRef = React.useRef(null);
|
|
424
425
|
React.useEffect(function () {
|
|
425
426
|
setIsClient(true);
|
|
426
427
|
}, []);
|
|
427
|
-
var
|
|
428
|
+
var handleClickPreview = React.useCallback(function () {
|
|
429
|
+
// Restore focus to the player wrapper after preview is clicked.
|
|
430
|
+
requestAnimationFrame(function () {
|
|
431
|
+
var _a;
|
|
432
|
+
(_a = playerWrapperRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
433
|
+
});
|
|
434
|
+
}, []);
|
|
435
|
+
var playerProps = tslib_es6.__assign(tslib_es6.__assign({}, player), { light: thumbnail, playIcon: React.createElement(VideoCardPlayIcon, { size: playIconSize }), muted: !thumbnail, playing: true, controls: true, className: styles$1.player, width: "100%", height: "100%", onClickPreview: handleClickPreview });
|
|
428
436
|
return (React.createElement("div", tslib_es6.__assign({ className: styles$1.container }, filterAttrs.filterAttrs(props)),
|
|
429
|
-
React.createElement("div", { "data-testid": "arc-video-card", className: index.classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React.createElement(src_default, tslib_es6.__assign({}, playerProps))),
|
|
437
|
+
React.createElement("div", { ref: playerWrapperRef, "data-testid": "arc-video-card", role: "button", tabIndex: -1, className: index.classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React.createElement(src_default, tslib_es6.__assign({}, playerProps))),
|
|
430
438
|
children));
|
|
431
439
|
};
|
|
432
440
|
|
|
@@ -419,12 +419,20 @@ var styles$1 = {"container":"VideoCardPlayer-module_container__G-Uta","player":"
|
|
|
419
419
|
var VideoCardPlayer = function (_a) {
|
|
420
420
|
var thumbnail = _a.thumbnail, playIconSize = _a.playIconSize, orientation = _a.orientation, children = _a.children, player = _a.player, props = __rest(_a, ["thumbnail", "playIconSize", "orientation", "children", "player"]);
|
|
421
421
|
var _b = useState(false), isClient = _b[0], setIsClient = _b[1];
|
|
422
|
+
var playerWrapperRef = useRef(null);
|
|
422
423
|
useEffect(function () {
|
|
423
424
|
setIsClient(true);
|
|
424
425
|
}, []);
|
|
425
|
-
var
|
|
426
|
+
var handleClickPreview = useCallback(function () {
|
|
427
|
+
// Restore focus to the player wrapper after preview is clicked.
|
|
428
|
+
requestAnimationFrame(function () {
|
|
429
|
+
var _a;
|
|
430
|
+
(_a = playerWrapperRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
431
|
+
});
|
|
432
|
+
}, []);
|
|
433
|
+
var playerProps = __assign(__assign({}, player), { light: thumbnail, playIcon: React__default.createElement(VideoCardPlayIcon, { size: playIconSize }), muted: !thumbnail, playing: true, controls: true, className: styles$1.player, width: "100%", height: "100%", onClickPreview: handleClickPreview });
|
|
426
434
|
return (React__default.createElement("div", __assign({ className: styles$1.container }, filterAttrs(props)),
|
|
427
|
-
React__default.createElement("div", { "data-testid": "arc-video-card", className: classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React__default.createElement(src_default, __assign({}, playerProps))),
|
|
435
|
+
React__default.createElement("div", { ref: playerWrapperRef, "data-testid": "arc-video-card", role: "button", tabIndex: -1, className: classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React__default.createElement(src_default, __assign({}, playerProps))),
|
|
428
436
|
children));
|
|
429
437
|
};
|
|
430
438
|
|