@scrippsproduct/networks-ui-library 2.0.4 → 2.0.5
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/dist/Carousel.module-Nwf_zL9b.mjs +14 -0
- package/dist/assets/Carousel.css +1 -1
- package/dist/assets/FindUs.css +1 -1
- package/dist/assets/LogoListItem.css +1 -1
- package/dist/components/AnchorTag/AnchorTag.js +12 -12
- package/dist/components/AnchorTag/AnchorTag.test.js +9 -19
- package/dist/components/BCVideoPlayer/BCVideoPlayer.js +58 -46
- package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +3 -3
- package/dist/components/Carousel/Carousel.js +37 -36
- package/dist/components/Carousel/Carousel.test.js +71 -68
- package/dist/components/Carousel/CarouselUtils.class.js +104 -97
- package/dist/components/Carousel/navigations/Pagination.js +2 -2
- package/dist/components/Carousel/navigations/Pagination.test.js +23 -23
- package/dist/components/CarouselSlide/CarouselSlide.test.js +58 -57
- package/dist/components/FindUs/FindUs.js +119 -90
- package/dist/components/GridList/GridList.js +6 -6
- package/dist/components/ImageCard/ImageCardCore.js +65 -69
- package/dist/components/ImageCard/ImageCardCore.test.js +2 -2
- package/dist/components/LogoListItem/LogoListItem.js +13 -13
- package/dist/components/PromotionsRowModule/PromotionsRowModule.js +42 -38
- package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +163 -149
- package/dist/hooks/useSourcepointPrivacyTrigger.js +4 -4
- package/dist/src/components/Carousel/CarouselUtils.class.d.ts +8 -3
- package/dist/src/components/Carousel/navigations/Pagination.d.ts +1 -1
- package/dist/src/components/PromotionsRowModule/PromotionsRowModule.d.ts +2 -1
- package/dist/src/hooks/useSourcepointPrivacyTrigger.d.ts +13 -2
- package/package.json +3 -2
- package/dist/Carousel.module-BsPaZX5L.mjs +0 -14
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { p as
|
|
1
|
+
import { jsxs as n, Fragment as R, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { p as M } from "../../index-5kXULIVv.mjs";
|
|
3
3
|
import { classes as a } from "../../utils/helpers.js";
|
|
4
|
-
import { AnchorTag as
|
|
5
|
-
import { ButtonAnchor as
|
|
6
|
-
import { ResponsiveImage as
|
|
7
|
-
const
|
|
8
|
-
image:
|
|
9
|
-
mobileImage:
|
|
10
|
-
lazyLoad:
|
|
11
|
-
fetchPriority:
|
|
12
|
-
decoding:
|
|
4
|
+
import { AnchorTag as g } from "../AnchorTag/AnchorTag.js";
|
|
5
|
+
import { ButtonAnchor as _ } from "../ButtonAnchor/ButtonAnchor.js";
|
|
6
|
+
import { ResponsiveImage as V } from "../ResponsiveImage/ResponsiveImage.js";
|
|
7
|
+
const q = ({
|
|
8
|
+
image: t = { url: "", altText: "", aspectRatio: 1, sources: [] },
|
|
9
|
+
mobileImage: m = { url: "", altText: "", aspectRatio: 1 },
|
|
10
|
+
lazyLoad: h = !0,
|
|
11
|
+
fetchPriority: l = void 0,
|
|
12
|
+
decoding: y = "async",
|
|
13
13
|
title: T = "",
|
|
14
|
-
content:
|
|
15
|
-
overlayContent:
|
|
14
|
+
content: p = "",
|
|
15
|
+
overlayContent: d = "",
|
|
16
16
|
cta: e = {
|
|
17
17
|
label: "",
|
|
18
18
|
href: "",
|
|
@@ -21,60 +21,60 @@ const U = ({
|
|
|
21
21
|
position: "end"
|
|
22
22
|
// inline - in the content | end | start
|
|
23
23
|
},
|
|
24
|
-
displayCTA:
|
|
25
|
-
handleClicks:
|
|
24
|
+
displayCTA: f = !0,
|
|
25
|
+
handleClicks: C = (c) => {
|
|
26
26
|
},
|
|
27
|
-
fullCardClickable:
|
|
27
|
+
fullCardClickable: v = !1,
|
|
28
28
|
styles: o = {}
|
|
29
29
|
}) => {
|
|
30
|
-
var
|
|
31
|
-
const
|
|
30
|
+
var N;
|
|
31
|
+
const c = /* @__PURE__ */ new Map([
|
|
32
32
|
["play-video", {
|
|
33
|
-
label: "View
|
|
34
|
-
component:
|
|
33
|
+
label: "View Video",
|
|
34
|
+
component: _
|
|
35
35
|
}],
|
|
36
36
|
["internal-link", {
|
|
37
37
|
label: "View More",
|
|
38
|
-
component:
|
|
38
|
+
component: g
|
|
39
39
|
}],
|
|
40
40
|
["external-link", {
|
|
41
41
|
label: "Learn More",
|
|
42
|
-
component:
|
|
42
|
+
component: g
|
|
43
43
|
}],
|
|
44
44
|
["info-panel", {
|
|
45
45
|
label: "View More",
|
|
46
|
-
component:
|
|
46
|
+
component: _
|
|
47
47
|
}],
|
|
48
48
|
["show-modal", {
|
|
49
49
|
label: "See More",
|
|
50
|
-
component:
|
|
50
|
+
component: _
|
|
51
51
|
}]
|
|
52
|
-
]),
|
|
53
|
-
r.stopPropagation(),
|
|
52
|
+
]), b = ["play-video", "show-modal", "info-panel"], u = (N = c.get(e.type)) == null ? void 0 : N.component, s = (r) => {
|
|
53
|
+
r.stopPropagation(), C({
|
|
54
54
|
type: e.type,
|
|
55
55
|
resourceId: e.relatedResourceId,
|
|
56
56
|
resourceType: e.relatedResourceType,
|
|
57
57
|
target: r.target,
|
|
58
58
|
currentTarget: r.currentTarget
|
|
59
59
|
});
|
|
60
|
-
},
|
|
61
|
-
var
|
|
62
|
-
if (!
|
|
63
|
-
const k =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
60
|
+
}, x = (r) => {
|
|
61
|
+
var A;
|
|
62
|
+
if (!u) return null;
|
|
63
|
+
const k = u === g, w = r.type === "internal-link" || r.type === "external-link";
|
|
64
|
+
return /* @__PURE__ */ i(
|
|
65
|
+
u,
|
|
66
66
|
{
|
|
67
67
|
classname: a([o["image-card__cta"], "image-card__cta"]),
|
|
68
68
|
"data-resource-id": r.relatedResourceId,
|
|
69
69
|
...k && { href: r.href },
|
|
70
|
-
label: r.label ? r.label : ((
|
|
71
|
-
...k &&
|
|
72
|
-
onClick:
|
|
70
|
+
label: r.label ? r.label : ((A = c.get(r.type)) == null ? void 0 : A.label) ?? "",
|
|
71
|
+
...k && w && r.type && { type: r.type },
|
|
72
|
+
onClick: !w && r.type ? s : void 0
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ n(R, { children: [
|
|
77
|
+
/* @__PURE__ */ n(
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
className: a([
|
|
@@ -82,42 +82,42 @@ const U = ({
|
|
|
82
82
|
"image-card__img-wrapper"
|
|
83
83
|
]),
|
|
84
84
|
children: [
|
|
85
|
-
|
|
85
|
+
m.url !== "" && /* @__PURE__ */ i(
|
|
86
86
|
"img",
|
|
87
87
|
{
|
|
88
|
-
alt:
|
|
88
|
+
alt: m.altText,
|
|
89
89
|
className: o["image-card__mobile-image"],
|
|
90
|
-
decoding:
|
|
91
|
-
...
|
|
92
|
-
loading:
|
|
93
|
-
src:
|
|
94
|
-
onClick: (e.type
|
|
90
|
+
decoding: y,
|
|
91
|
+
...l && { fetchpriority: l },
|
|
92
|
+
loading: h ? "lazy" : void 0,
|
|
93
|
+
src: m.url,
|
|
94
|
+
onClick: b.includes(e.type) && !v ? s : void 0
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
97
|
+
/* @__PURE__ */ i(
|
|
98
|
+
V,
|
|
99
99
|
{
|
|
100
|
-
altText:
|
|
100
|
+
altText: t.altText,
|
|
101
101
|
classname: o["image-card__image"],
|
|
102
|
-
decoding:
|
|
103
|
-
fetchPriority:
|
|
104
|
-
fullSizeUrl:
|
|
105
|
-
handleClick: (e.type
|
|
106
|
-
loading:
|
|
107
|
-
sources:
|
|
102
|
+
decoding: y,
|
|
103
|
+
fetchPriority: l !== "auto" ? l : void 0,
|
|
104
|
+
fullSizeUrl: t.url,
|
|
105
|
+
handleClick: b.includes(e.type) && !v ? s : void 0,
|
|
106
|
+
loading: h ? "lazy" : void 0,
|
|
107
|
+
sources: t.sources
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
|
-
|
|
110
|
+
d !== "" && /* @__PURE__ */ i(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
113
|
className: a([
|
|
114
114
|
o["image-card__overlay-content"],
|
|
115
115
|
"image-card__overlay-content"
|
|
116
116
|
]),
|
|
117
|
-
children: typeof
|
|
117
|
+
children: typeof d == "string" ? M(d) : d
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
(e == null ? void 0 : e.type) === "play-video" && /* @__PURE__ */
|
|
120
|
+
(e == null ? void 0 : e.type) === "play-video" && /* @__PURE__ */ n(
|
|
121
121
|
"button",
|
|
122
122
|
{
|
|
123
123
|
className: a([
|
|
@@ -127,28 +127,24 @@ const U = ({
|
|
|
127
127
|
type: "button",
|
|
128
128
|
onClick: s,
|
|
129
129
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ i("span", { className: "sr-only", children: "PLAY BUTTON" }),
|
|
131
|
+
/* @__PURE__ */ i("div", { className: `${o["play-icon__triangle"]}` })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
]
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
|
-
|
|
139
|
-
T !== "" && /* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
] }),
|
|
144
|
-
typeof l != "string" && /* @__PURE__ */ i(N, { children: [
|
|
145
|
-
l,
|
|
146
|
-
g && (e == null ? void 0 : e.type) && e.position === "inline" && _(e)
|
|
138
|
+
p !== "" && /* @__PURE__ */ n("div", { className: a([o["image-card__content"], "image-card__content"]), children: [
|
|
139
|
+
T !== "" && /* @__PURE__ */ i("h2", { className: "h4", children: T }),
|
|
140
|
+
/* @__PURE__ */ n(R, { children: [
|
|
141
|
+
typeof p == "string" ? M(p) : p,
|
|
142
|
+
f && (e == null ? void 0 : e.type) && e.position === "inline" && x(e)
|
|
147
143
|
] })
|
|
148
144
|
] }),
|
|
149
|
-
|
|
145
|
+
f && (e == null ? void 0 : e.type) && (e == null ? void 0 : e.position) === "end" && /* @__PURE__ */ i("div", { className: o["image-card__cta-wrapper"], children: x(e) })
|
|
150
146
|
] });
|
|
151
147
|
};
|
|
152
148
|
export {
|
|
153
|
-
|
|
149
|
+
q as default
|
|
154
150
|
};
|
|
@@ -483,9 +483,9 @@ p("ImageCardCore", () => {
|
|
|
483
483
|
t(e).not.toBeInTheDocument();
|
|
484
484
|
});
|
|
485
485
|
}), p("Default CTA Labels", () => {
|
|
486
|
-
l('should use "View
|
|
486
|
+
l('should use "View Video" for play-video when no label', () => {
|
|
487
487
|
const e = r({ type: "play-video", label: "" });
|
|
488
|
-
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View
|
|
488
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View Video")).toBeInTheDocument();
|
|
489
489
|
}), l('should use "View More" for internal-link when no label', () => {
|
|
490
490
|
const e = r({ type: "internal-link", label: "" });
|
|
491
491
|
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View More")).toBeInTheDocument();
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, Fragment as o, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { classes as l } from "../../utils/helpers.js";
|
|
3
3
|
import '../../assets/LogoListItem.css';const s = {
|
|
4
|
-
"icon-list-item": "_icon-list-
|
|
5
|
-
"icon-list-item__link": "_icon-list-
|
|
6
|
-
"icon-list-item__img-wrapper": "_icon-list-item__img-
|
|
4
|
+
"icon-list-item": "_icon-list-item_1j8qa_1",
|
|
5
|
+
"icon-list-item__link": "_icon-list-item__link_1j8qa_18",
|
|
6
|
+
"icon-list-item__img-wrapper": "_icon-list-item__img-wrapper_1j8qa_19"
|
|
7
7
|
};
|
|
8
8
|
function r({
|
|
9
|
-
imageSource:
|
|
9
|
+
imageSource: m,
|
|
10
10
|
href: t = "",
|
|
11
|
-
altText:
|
|
11
|
+
altText: e = "",
|
|
12
12
|
target: c = "_self"
|
|
13
13
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
t !== "" && /* @__PURE__ */ i("li", { className: l([s["icon-list-item"], "icon-list-item"]), children: /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ n(o, { children: [
|
|
15
|
+
t !== "" && /* @__PURE__ */ i("li", { className: l([s["icon-list-item"], "icon-list-item"]), children: /* @__PURE__ */ n(
|
|
16
16
|
"a",
|
|
17
17
|
{
|
|
18
18
|
className: l([s["icon-list-item__link"], "icon-list-item__link"]),
|
|
19
19
|
href: t,
|
|
20
20
|
target: c,
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */ i("span", { className: "sr-only", children:
|
|
22
|
+
/* @__PURE__ */ i("span", { className: "sr-only", children: e }),
|
|
23
23
|
/* @__PURE__ */ i(
|
|
24
24
|
"img",
|
|
25
25
|
{
|
|
26
|
-
alt: `${
|
|
26
|
+
alt: `${e} logo`,
|
|
27
27
|
className: s["ion-list-item__image"],
|
|
28
|
-
src:
|
|
28
|
+
src: m
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
]
|
|
@@ -34,8 +34,8 @@ function r({
|
|
|
34
34
|
t === "" && /* @__PURE__ */ i("li", { className: l([s["icon-list-item"], "icon-list-item"]), children: /* @__PURE__ */ i("span", { className: l([s["icon-list-item__img-wrapper"], "icon-list-item__img-wrapper"]), children: /* @__PURE__ */ i(
|
|
35
35
|
"img",
|
|
36
36
|
{
|
|
37
|
-
alt: `${
|
|
38
|
-
src:
|
|
37
|
+
alt: `${e} logo`,
|
|
38
|
+
src: m
|
|
39
39
|
}
|
|
40
40
|
) }) })
|
|
41
41
|
] });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { classes as
|
|
4
|
-
import { PromotionsRowBlock as
|
|
1
|
+
import { jsx as a, jsxs as w, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useMemo as I, useEffect as b } from "react";
|
|
3
|
+
import { classes as m } from "../../utils/helpers.js";
|
|
4
|
+
import { PromotionsRowBlock as _ } from "../PromotionsRowBlock/PromotionsRowBlock.js";
|
|
5
5
|
import { ImageCard as B } from "../ImageCard/ImageCard.js";
|
|
6
6
|
import { Carousel as G } from "../Carousel/Carousel.js";
|
|
7
|
-
import { CtaBlock as
|
|
8
|
-
import '../../assets/PromotionsRowModule.css';const
|
|
7
|
+
import { CtaBlock as S } from "../CtaBlock/CtaBlock.js";
|
|
8
|
+
import '../../assets/PromotionsRowModule.css';const A = {
|
|
9
9
|
paginationType: "dots",
|
|
10
10
|
showControls: !0,
|
|
11
11
|
controlButtonsOffset: -4,
|
|
@@ -25,17 +25,21 @@ import '../../assets/PromotionsRowModule.css';const P = {
|
|
|
25
25
|
cellsPosition: "flex-start",
|
|
26
26
|
wrapAround: !1
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
title:
|
|
30
|
-
promos:
|
|
31
|
-
|
|
28
|
+
function D({
|
|
29
|
+
title: u = "",
|
|
30
|
+
promos: s = [],
|
|
31
|
+
shouldClampContent: y = !0,
|
|
32
|
+
handleClicks: d = null
|
|
32
33
|
}) {
|
|
33
|
-
const [
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
const [f, P] = x([]), C = () => {
|
|
35
|
+
}, c = I(() => y ? s.map((n) => n.content ? {
|
|
36
|
+
...n,
|
|
37
|
+
content: /* @__PURE__ */ a("div", { className: "promotions-row__clamped-content", children: n.content })
|
|
38
|
+
} : n) : s, [s, y]);
|
|
39
|
+
return b(() => {
|
|
40
|
+
const t = (n) => {
|
|
41
|
+
const o = n.map((e) => {
|
|
42
|
+
var l, i, r;
|
|
39
43
|
return {
|
|
40
44
|
title: "",
|
|
41
45
|
layout: "ImageCard",
|
|
@@ -47,56 +51,56 @@ function T({
|
|
|
47
51
|
},
|
|
48
52
|
title: e.title,
|
|
49
53
|
content: e.content,
|
|
50
|
-
handleClicks:
|
|
54
|
+
handleClicks: d ?? C,
|
|
51
55
|
relatedResourceId: e.id,
|
|
52
56
|
overlayContent: e != null && e.overlayContent ? /* @__PURE__ */ a(
|
|
53
|
-
|
|
57
|
+
S,
|
|
54
58
|
{
|
|
55
59
|
content: (l = e.overlayContent) == null ? void 0 : l.content,
|
|
56
60
|
cta: (i = e.overlayContent) == null ? void 0 : i.cta,
|
|
57
|
-
title: (
|
|
61
|
+
title: (r = e.overlayContent) == null ? void 0 : r.title
|
|
58
62
|
}
|
|
59
63
|
) : "",
|
|
60
64
|
cta: e.cta
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
});
|
|
64
|
-
|
|
68
|
+
P(o);
|
|
65
69
|
};
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
/* @__PURE__ */ a("h1", { className: ["h3", "promotions-row__header"].join(" "), children:
|
|
70
|
+
c.length > 4 && t(c);
|
|
71
|
+
}, [c, d]), s.length > 4 && f.length ? /* @__PURE__ */ w(R, { children: [
|
|
72
|
+
/* @__PURE__ */ a("h1", { className: ["h3", "promotions-row__header"].join(" "), children: u }),
|
|
69
73
|
/* @__PURE__ */ a(
|
|
70
74
|
G,
|
|
71
75
|
{
|
|
72
|
-
cells:
|
|
76
|
+
cells: f,
|
|
73
77
|
id: `promotions-row-${Date.now()}`,
|
|
74
|
-
options:
|
|
78
|
+
options: A
|
|
75
79
|
}
|
|
76
80
|
)
|
|
77
|
-
] }) : /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */ a("h2", { className:
|
|
79
|
-
/* @__PURE__ */ a(
|
|
80
|
-
var
|
|
81
|
+
] }) : /* @__PURE__ */ w("section", { className: "promotions-row", children: [
|
|
82
|
+
/* @__PURE__ */ a("h2", { className: m(["h2", "promotions-row__header"]), children: u }),
|
|
83
|
+
/* @__PURE__ */ a(_, { gap: "2rem", children: c.map((t) => {
|
|
84
|
+
var n, o, e, l, i, r, g, h, v;
|
|
81
85
|
return /* @__PURE__ */ a(
|
|
82
86
|
B,
|
|
83
87
|
{
|
|
84
88
|
classname: t == null ? void 0 : t.classname,
|
|
85
89
|
content: t.content,
|
|
86
90
|
cta: t.cta,
|
|
87
|
-
handleClicks: ((
|
|
91
|
+
handleClicks: ((n = t == null ? void 0 : t.cta) == null ? void 0 : n.type) === "play-video" ? d ?? C : () => !0,
|
|
88
92
|
image: t.image,
|
|
89
93
|
overlayContent: t.overlayContent ? /* @__PURE__ */ a(
|
|
90
|
-
|
|
94
|
+
S,
|
|
91
95
|
{
|
|
92
|
-
btnGradientEndColor: (
|
|
96
|
+
btnGradientEndColor: (o = t.overlayContent) == null ? void 0 : o.btnGradientEndColor,
|
|
93
97
|
btnGradientStartColor: (e = t.overlayContent) == null ? void 0 : e.btnGradientStartColor,
|
|
94
98
|
content: (l = t.overlayContent) == null ? void 0 : l.content,
|
|
95
99
|
cta: (i = t.overlayContent) == null ? void 0 : i.cta,
|
|
96
|
-
ctaButtonStyle: (
|
|
97
|
-
title: (
|
|
98
|
-
titleImageUrl: (
|
|
99
|
-
type: (
|
|
100
|
+
ctaButtonStyle: (r = t.overlayContent) == null ? void 0 : r.ctaButtonStyle,
|
|
101
|
+
title: (g = t.overlayContent) == null ? void 0 : g.title,
|
|
102
|
+
titleImageUrl: (h = t.overlayContent) == null ? void 0 : h.titleImageUrl,
|
|
103
|
+
type: (v = t.overlayContent) == null ? void 0 : v.type
|
|
100
104
|
}
|
|
101
105
|
) : "",
|
|
102
106
|
relatedResourceId: t.id,
|
|
@@ -108,6 +112,6 @@ function T({
|
|
|
108
112
|
] });
|
|
109
113
|
}
|
|
110
114
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
D as PromotionsRowModule,
|
|
116
|
+
D as default
|
|
113
117
|
};
|