@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.
Files changed (28) hide show
  1. package/dist/Carousel.module-Nwf_zL9b.mjs +14 -0
  2. package/dist/assets/Carousel.css +1 -1
  3. package/dist/assets/FindUs.css +1 -1
  4. package/dist/assets/LogoListItem.css +1 -1
  5. package/dist/components/AnchorTag/AnchorTag.js +12 -12
  6. package/dist/components/AnchorTag/AnchorTag.test.js +9 -19
  7. package/dist/components/BCVideoPlayer/BCVideoPlayer.js +58 -46
  8. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +3 -3
  9. package/dist/components/Carousel/Carousel.js +37 -36
  10. package/dist/components/Carousel/Carousel.test.js +71 -68
  11. package/dist/components/Carousel/CarouselUtils.class.js +104 -97
  12. package/dist/components/Carousel/navigations/Pagination.js +2 -2
  13. package/dist/components/Carousel/navigations/Pagination.test.js +23 -23
  14. package/dist/components/CarouselSlide/CarouselSlide.test.js +58 -57
  15. package/dist/components/FindUs/FindUs.js +119 -90
  16. package/dist/components/GridList/GridList.js +6 -6
  17. package/dist/components/ImageCard/ImageCardCore.js +65 -69
  18. package/dist/components/ImageCard/ImageCardCore.test.js +2 -2
  19. package/dist/components/LogoListItem/LogoListItem.js +13 -13
  20. package/dist/components/PromotionsRowModule/PromotionsRowModule.js +42 -38
  21. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +163 -149
  22. package/dist/hooks/useSourcepointPrivacyTrigger.js +4 -4
  23. package/dist/src/components/Carousel/CarouselUtils.class.d.ts +8 -3
  24. package/dist/src/components/Carousel/navigations/Pagination.d.ts +1 -1
  25. package/dist/src/components/PromotionsRowModule/PromotionsRowModule.d.ts +2 -1
  26. package/dist/src/hooks/useSourcepointPrivacyTrigger.d.ts +13 -2
  27. package/package.json +3 -2
  28. package/dist/Carousel.module-BsPaZX5L.mjs +0 -14
@@ -1,18 +1,18 @@
1
- import { jsxs as i, Fragment as N, jsx as n } from "react/jsx-runtime";
2
- import { p as R } from "../../index-5kXULIVv.mjs";
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 y } from "../AnchorTag/AnchorTag.js";
5
- import { ButtonAnchor as h } from "../ButtonAnchor/ButtonAnchor.js";
6
- import { ResponsiveImage as B } from "../ResponsiveImage/ResponsiveImage.js";
7
- const U = ({
8
- image: d = { url: "", altText: "", aspectRatio: 1, sources: [] },
9
- mobileImage: t = { url: "", altText: "", aspectRatio: 1 },
10
- lazyLoad: f = !0,
11
- fetchPriority: m = void 0,
12
- decoding: v = "async",
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: l = "",
15
- overlayContent: p = "",
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: g = !0,
25
- handleClicks: A = (u) => {
24
+ displayCTA: f = !0,
25
+ handleClicks: C = (c) => {
26
26
  },
27
- fullCardClickable: x = !1,
27
+ fullCardClickable: v = !1,
28
28
  styles: o = {}
29
29
  }) => {
30
- var b;
31
- const u = /* @__PURE__ */ new Map([
30
+ var N;
31
+ const c = /* @__PURE__ */ new Map([
32
32
  ["play-video", {
33
- label: "View Promo",
34
- component: h
33
+ label: "View Video",
34
+ component: _
35
35
  }],
36
36
  ["internal-link", {
37
37
  label: "View More",
38
- component: y
38
+ component: g
39
39
  }],
40
40
  ["external-link", {
41
41
  label: "Learn More",
42
- component: y
42
+ component: g
43
43
  }],
44
44
  ["info-panel", {
45
45
  label: "View More",
46
- component: h
46
+ component: _
47
47
  }],
48
48
  ["show-modal", {
49
49
  label: "See More",
50
- component: h
50
+ component: _
51
51
  }]
52
- ]), c = (b = u.get(e.type)) == null ? void 0 : b.component, s = (r) => {
53
- r.stopPropagation(), A({
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
- }, _ = (r) => {
61
- var w;
62
- if (!c) return null;
63
- const k = c === y, M = r.type === "internal-link" || r.type === "external-link";
64
- return /* @__PURE__ */ n(
65
- c,
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 : ((w = u.get(r.type)) == null ? void 0 : w.label) ?? "",
71
- ...k && M && r.type && { type: r.type },
72
- onClick: r.type !== "internal-link" && r.type !== "external-link" ? s : void 0
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__ */ i(N, { children: [
77
- /* @__PURE__ */ i(
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
- t.url !== "" && /* @__PURE__ */ n(
85
+ m.url !== "" && /* @__PURE__ */ i(
86
86
  "img",
87
87
  {
88
- alt: t.altText,
88
+ alt: m.altText,
89
89
  className: o["image-card__mobile-image"],
90
- decoding: v,
91
- ...m && { fetchpriority: m },
92
- loading: f ? "lazy" : void 0,
93
- src: t.url,
94
- onClick: (e.type === "play-video" || e.type === "show-modal") && !x ? s : void 0
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__ */ n(
98
- B,
97
+ /* @__PURE__ */ i(
98
+ V,
99
99
  {
100
- altText: d.altText,
100
+ altText: t.altText,
101
101
  classname: o["image-card__image"],
102
- decoding: v,
103
- fetchPriority: m,
104
- fullSizeUrl: d.url,
105
- handleClick: (e.type === "play-video" || e.type === "show-modal") && !x ? (r) => (s(r), !1) : () => !0,
106
- loading: f ? "lazy" : void 0,
107
- sources: d.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
- p !== "" && /* @__PURE__ */ n(
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 p == "string" ? R(p) : p
117
+ children: typeof d == "string" ? M(d) : d
118
118
  }
119
119
  ),
120
- (e == null ? void 0 : e.type) === "play-video" && /* @__PURE__ */ i(
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__ */ n("span", { className: "sr-only", children: "PLAY BUTTON" }),
131
- /* @__PURE__ */ n("div", { className: `${o["play-icon__triangle"]}` })
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
- l !== "" && /* @__PURE__ */ i("div", { className: a([o["image-card__content"], "image-card__content"]), children: [
139
- T !== "" && /* @__PURE__ */ n("h2", { className: "h4", children: T }),
140
- typeof l == "string" && /* @__PURE__ */ i("div", { children: [
141
- R(l),
142
- g && (e == null ? void 0 : e.type) && e.position === "inline" && _(e)
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
- g && (e == null ? void 0 : e.type) && (e == null ? void 0 : e.position) === "end" && /* @__PURE__ */ n("div", { className: o["image-card__cta-wrapper"], children: _(e) })
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
- U as default
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 Promo" for play-video when no label', () => {
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 Promo")).toBeInTheDocument();
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 m, Fragment as o, jsx as i } from "react/jsx-runtime";
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-item_19qvn_1",
5
- "icon-list-item__link": "_icon-list-item__link_19qvn_18",
6
- "icon-list-item__img-wrapper": "_icon-list-item__img-wrapper_19qvn_19"
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: e,
9
+ imageSource: m,
10
10
  href: t = "",
11
- altText: n = "",
11
+ altText: e = "",
12
12
  target: c = "_self"
13
13
  }) {
14
- return /* @__PURE__ */ m(o, { children: [
15
- t !== "" && /* @__PURE__ */ i("li", { className: l([s["icon-list-item"], "icon-list-item"]), children: /* @__PURE__ */ m(
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: n }),
22
+ /* @__PURE__ */ i("span", { className: "sr-only", children: e }),
23
23
  /* @__PURE__ */ i(
24
24
  "img",
25
25
  {
26
- alt: `${n} logo`,
26
+ alt: `${e} logo`,
27
27
  className: s["ion-list-item__image"],
28
- src: e
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: `${n} logo`,
38
- src: e
37
+ alt: `${e} logo`,
38
+ src: m
39
39
  }
40
40
  ) }) })
41
41
  ] });
@@ -1,11 +1,11 @@
1
- import { jsxs as h, Fragment as S, jsx as a } from "react/jsx-runtime";
2
- import { useState as R, useEffect as x } from "react";
3
- import { classes as I } from "../../utils/helpers.js";
4
- import { PromotionsRowBlock as b } from "../PromotionsRowBlock/PromotionsRowBlock.js";
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 v } from "../CtaBlock/CtaBlock.js";
8
- import '../../assets/PromotionsRowModule.css';const P = {
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 T({
29
- title: d = "",
30
- promos: n = [],
31
- handleClicks: o = null
28
+ function D({
29
+ title: u = "",
30
+ promos: s = [],
31
+ shouldClampContent: y = !0,
32
+ handleClicks: d = null
32
33
  }) {
33
- const [u, w] = R([]), y = () => {
34
- };
35
- return x(() => {
36
- const t = (r) => {
37
- const c = r.map((e) => {
38
- var l, i, s;
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: o ?? y,
54
+ handleClicks: d ?? C,
51
55
  relatedResourceId: e.id,
52
56
  overlayContent: e != null && e.overlayContent ? /* @__PURE__ */ a(
53
- v,
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: (s = e.overlayContent) == null ? void 0 : s.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
- w(c);
68
+ P(o);
65
69
  };
66
- n.length > 4 && t(n);
67
- }, [n, o]), n.length > 4 && u.length ? /* @__PURE__ */ h(S, { children: [
68
- /* @__PURE__ */ a("h1", { className: ["h3", "promotions-row__header"].join(" "), children: d }),
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: u,
76
+ cells: f,
73
77
  id: `promotions-row-${Date.now()}`,
74
- options: P
78
+ options: A
75
79
  }
76
80
  )
77
- ] }) : /* @__PURE__ */ h("section", { className: "promotions-row", children: [
78
- /* @__PURE__ */ a("h2", { className: I(["h2", "promotions-row__header"]), children: d }),
79
- /* @__PURE__ */ a(b, { gap: "2rem", children: n.map((t) => {
80
- var r, c, e, l, i, s, C, f, g;
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: ((r = t == null ? void 0 : t.cta) == null ? void 0 : r.type) === "play-video" ? o ?? y : () => !0,
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
- v,
94
+ S,
91
95
  {
92
- btnGradientEndColor: (c = t.overlayContent) == null ? void 0 : c.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: (s = t.overlayContent) == null ? void 0 : s.ctaButtonStyle,
97
- title: (C = t.overlayContent) == null ? void 0 : C.title,
98
- titleImageUrl: (f = t.overlayContent) == null ? void 0 : f.titleImageUrl,
99
- type: (g = t.overlayContent) == null ? void 0 : g.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
- T as PromotionsRowModule,
112
- T as default
115
+ D as PromotionsRowModule,
116
+ D as default
113
117
  };