@scrippsproduct/networks-ui-library 2.0.11-alpha.0 → 2.0.11-alpha.1

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.
@@ -1 +1 @@
1
- image-card{--overlay-content-text-color: #fff;--align-overlay-content: flex-end;--justify-overlay-content: flex-start;display:flex;flex-direction:column;justify-content:stretch;box-sizing:border-box;height:100%;margin:0;padding:0 0 1rem}._image-card--clickable_1tnka_14{cursor:pointer}._image-card__img-wrapper_1tnka_18{display:grid;grid-template-areas:"img"}._image-card__img-wrapper_1tnka_18>*{grid-area:img;place-self:var(--align-overlay-content) var(--justify-overlay-content)}._image-card__img-wrapper_1tnka_18>*>*{padding:0 1.5rem;color:var(--overlay-content-text-color);text-shadow:1px 1px 2px rgba(0,0,0,.4)}._image-card__img-wrapper_1tnka_18>*>source{display:contents}._image-card--inline_1tnka_35 ._image-card__img-wrapper_1tnka_18{flex:0 1 min(50%,750px)}._image-card__image_1tnka_39{width:100%;padding:0!important}._image-card__image_1tnka_39>img,._image-card__mobile-image_1tnka_45{aspect-ratio:var(--image-aspect-ratio);width:100%;padding:0;object-fit:cover;object-position:var(--background-image-position);background-color:#efefef}._image-card__mobile-image_1tnka_45{display:none;aspect-ratio:var(--mobile-image-aspect-ratio);object-position:var(--mobile-background-image-position)}@media screen and (max-width:700px){._image-card__mobile-image_1tnka_45{display:block}._image-card__image_1tnka_39{object-position:var(--mobile-background-image-position)}._image-card__mobile-image_1tnka_45~._image-card__image_1tnka_39{display:none}}._image-card--inline_1tnka_35{flex-direction:row;gap:2.5rem;padding:0}._image-card__play-icon_1tnka_77{cursor:pointer;position:relative;overflow:hidden;display:grid;place-self:center center;padding:1.5rem;border:1px rgba(0,0,0,.4) dotted;border-radius:50%;background-color:#ffffff80;transition:scale .225s ease-in-out}._image-card__play-icon_1tnka_77>._play-icon__triangle_1tnka_89{position:absolute;top:32%;left:35%;display:block;width:0;height:0;border-top:.6rem solid transparent;border-right:none;border-bottom:.6rem solid transparent;border-left:1.2rem solid rgba(0,0,0,.5);background-color:transparent;transition:scale .225s ease-in-out,left .225s ease-in-out}._image-card__play-icon_1tnka_77:hover{scale:1.1}._image-card__play-icon_1tnka_77:hover>._play-icon__triangle_1tnka_89{left:42%;scale:1.1}._image-card__content_1tnka_111{padding:1.5rem 0 .5rem;text-align:left}._image-card__content_1tnka_111>div{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--content-line-clamp);line-clamp:var(--content-line-clamp);margin:1.5em 0}._image-card__content_1tnka_111 h2{margin-top:0}._image-card--inline_1tnka_35 ._image-card__content_1tnka_111{align-self:center;padding:0}._image-card__cta-wrapper_1tnka_132{justify-self:flex-end;margin-top:auto}._image-card__cta_1tnka_132{color:var(--base-anchor-color);text-align:left}._image-card__overlay-content_1tnka_142{padding-bottom:1.5rem}image-card.sports-leauge-card{padding-block-end:1.5rem;border-radius:20px;color:#fff;background-color:#671982}image-card.sports-leauge-card .leauge-card__content,image-card.sports-leauge-card .h4,image-card.sports-leauge-card .image-card__cta-wrapper{padding-inline:1.5rem}image-card.sports-leauge-card .image-card__content>div{margin-block:1rem}image-card.sports-leauge-card .image-card__img-wrapper img{border-radius:20px 20px 0 0}image-card.sports-leauge-card .h4{margin-block-end:0}image-card.sports-leauge-card .image-card__cta{display:block;padding-block:1rem;border-radius:20px;font-weight:500;color:#fff;text-align:center;text-decoration:none;background-color:#a026a0;transition:transform .3s ease}image-card.sports-leauge-card .image-card__cta:hover{transform:scale3d(1.05,1.05,1.05)}image-card.sports-leauge-card .league-card__date{margin-block-end:.5rem;font-size:.875rem}image-card.sports-leauge-card .league-card__teams{font-size:1.2rem;font-weight:500}
1
+ image-card{--overlay-content-text-color: #fff;--align-overlay-content: flex-end;--justify-overlay-content: flex-start;display:flex;flex-direction:column;justify-content:stretch;box-sizing:border-box;height:100%;margin:0;padding:0 0 1rem}._image-card--clickable_1tnka_14{cursor:pointer}._image-card__img-wrapper_1tnka_18{display:grid;grid-template-areas:"img"}._image-card__img-wrapper_1tnka_18>*{grid-area:img;place-self:var(--align-overlay-content) var(--justify-overlay-content)}._image-card__img-wrapper_1tnka_18>*>*{padding:0 1.5rem;color:var(--overlay-content-text-color);text-shadow:1px 1px 2px rgba(0,0,0,.4)}._image-card__img-wrapper_1tnka_18>*>source{display:contents}._image-card--inline_1tnka_35 ._image-card__img-wrapper_1tnka_18{flex:0 1 min(50%,750px)}._image-card__image_1tnka_39{width:100%;padding:0!important}._image-card__image_1tnka_39>img,._image-card__mobile-image_1tnka_45{aspect-ratio:var(--image-aspect-ratio);width:100%;padding:0;object-fit:cover;object-position:var(--background-image-position);background-color:#efefef}._image-card__mobile-image_1tnka_45{display:none;aspect-ratio:var(--mobile-image-aspect-ratio);object-position:var(--mobile-background-image-position)}@media screen and (max-width:700px){._image-card__mobile-image_1tnka_45{display:block}._image-card__image_1tnka_39{object-position:var(--mobile-background-image-position)}._image-card__mobile-image_1tnka_45~._image-card__image_1tnka_39{display:none}}._image-card--inline_1tnka_35{flex-direction:row;gap:2.5rem;padding:0}._image-card__play-icon_1tnka_77{cursor:pointer;position:relative;overflow:hidden;display:grid;place-self:center center;padding:1.5rem;border:1px rgba(0,0,0,.4) dotted;border-radius:50%;background-color:#ffffff80;transition:scale .225s ease-in-out}._image-card__play-icon_1tnka_77>._play-icon__triangle_1tnka_89{position:absolute;top:32%;left:35%;display:block;width:0;height:0;border-top:.6rem solid transparent;border-right:none;border-bottom:.6rem solid transparent;border-left:1.2rem solid rgba(0,0,0,.5);background-color:transparent;transition:scale .225s ease-in-out,left .225s ease-in-out}._image-card__play-icon_1tnka_77:hover{scale:1.1}._image-card__play-icon_1tnka_77:hover>._play-icon__triangle_1tnka_89{left:42%;scale:1.1}._image-card__content_1tnka_111{padding:1.5rem 0 .5rem;text-align:left}._image-card__content_1tnka_111>div{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--content-line-clamp);line-clamp:var(--content-line-clamp);margin:1.5em 0}._image-card__content_1tnka_111 h2{margin-top:0}._image-card--inline_1tnka_35 ._image-card__content_1tnka_111{align-self:center;padding:0}._image-card__cta-wrapper_1tnka_132{justify-self:flex-end;margin-top:auto}._image-card__cta_1tnka_132{color:var(--base-anchor-color);text-align:left}._image-card__overlay-content_1tnka_142{padding-bottom:1.5rem}image-card.sports-leauge-card{padding-block-end:1.5rem;border-radius:20px;color:#fff;background-color:#671982}image-card.sports-leauge-card .leauge-card__content,image-card.sports-leauge-card .h4,image-card.sports-leauge-card .image-card__cta-wrapper{padding-inline:1.5rem}image-card.sports-leauge-card .image-card__content>div{margin-block:1rem}image-card.sports-leauge-card .image-card__img-wrapper img{border-radius:20px 20px 0 0}image-card.sports-leauge-card .h4{margin-block-end:0}image-card.sports-leauge-card .image-card__cta{display:block;padding:1rem;border-radius:20px;font-weight:500;color:#fff;text-align:center;text-decoration:none;background-color:#a026a0;transition:transform .3s ease}image-card.sports-leauge-card .image-card__cta:hover{transform:scale3d(1.05,1.05,1.05)}image-card.sports-leauge-card .league-card__date{margin-block-end:.5rem;font-size:.875rem}image-card.sports-leauge-card .league-card__teams{font-size:1.2rem;font-weight:500}
@@ -1,17 +1,74 @@
1
- import { jsx as l, Fragment as ee, jsxs as j } from "react/jsx-runtime";
2
- import { useRef as i, useState as m, useEffect as B, useCallback as u, Suspense as re } from "react";
3
- import { chunkArray as te, classes as g } from "../../utils/helpers.js";
4
- import ne from "./CarouselUtils.class.js";
5
- import { CarouselSlide as le } from "../CarouselSlide/CarouselSlide.js";
6
- import { Loading as ce } from "../Loading/Loading.js";
7
- import { c as a } from "../../Carousel.module-Nwf_zL9b.mjs";
1
+ import { jsx as s, Fragment as Y, jsxs as K } from "react/jsx-runtime";
2
+ import { useRef as d, useState as v, useEffect as U, useCallback as S, Suspense as ee } from "react";
3
+ import { chunkArray as re, classes as _ } from "../../utils/helpers.js";
4
+ import te from "./CarouselUtils.class.js";
5
+ import { CarouselSlide as ne } from "../CarouselSlide/CarouselSlide.js";
6
+ import { Loading as le } from "../Loading/Loading.js";
7
+ import { c as f } from "../../Carousel.module-Nwf_zL9b.mjs";
8
8
  import { C as oe } from "../../chevron-left-D0UjbrKw.mjs";
9
- import { C as se } from "../../chevron-right-0ZF3LruR.mjs";
10
- const P = window.matchMedia("(width <= 600px)"), b = window.matchMedia("(width <= 800px"), z = window.matchMedia("(width <= 1024px"), E = window.matchMedia("(width <= 1280px");
11
- function we({
12
- id: L,
13
- cells: w,
14
- options: x = {
9
+ import { C as ce } from "../../chevron-right-0ZF3LruR.mjs";
10
+ const R = 10, G = {
11
+ one: 1,
12
+ two: 2,
13
+ three: 3,
14
+ four: 4,
15
+ five: 5,
16
+ six: 6,
17
+ seven: 7,
18
+ eight: 8,
19
+ nine: 9,
20
+ ten: 10
21
+ }, se = {
22
+ one: 600,
23
+ two: 800,
24
+ three: 1024,
25
+ four: 1750
26
+ }, ie = {
27
+ one: ({ wrapAround: o }, c) => ({
28
+ showControls: !1,
29
+ showPagination: !1,
30
+ cellsPerSlide: c,
31
+ cellsPosition: o ? "center" : "flex-start",
32
+ gutterSize: R
33
+ }),
34
+ two: ({ cellsPerSlide: o }, c) => ({
35
+ showControls: !1,
36
+ gutterSize: R,
37
+ cellsPerSlide: y(o, c)
38
+ }),
39
+ three: ({ cellsPerSlide: o }, c) => ({
40
+ showControls: !1,
41
+ gutterSize: R,
42
+ cellsPerSlide: y(o, c)
43
+ }),
44
+ four: ({ cellsPerSlide: o, showPagination: c }, l) => ({
45
+ showControls: !c,
46
+ cellsPerSlide: y(o, l)
47
+ })
48
+ };
49
+ function y(o, c) {
50
+ return Math.min(o || c, c);
51
+ }
52
+ function ae(o = {}) {
53
+ return Object.keys(G).map((l) => {
54
+ const { width: i = se[l], cellsPerSlide: p = G[l] } = o[l] ?? {};
55
+ return { name: l, width: i, cellsPerSlide: p };
56
+ }).filter((l) => l.width !== void 0).sort((l, i) => l.width - i.width).map(({ name: l, width: i, cellsPerSlide: p }) => ({
57
+ name: l,
58
+ cellsPerSlide: p,
59
+ mediaQuery: window.matchMedia(`(width <= ${i}px)`)
60
+ }));
61
+ }
62
+ function ue(o, c) {
63
+ const l = c.find(({ mediaQuery: p }) => p.matches);
64
+ if (!l) return {};
65
+ const i = ie[l.name];
66
+ return i ? i(o, l.cellsPerSlide) : { cellsPerSlide: y(o.cellsPerSlide, l.cellsPerSlide) };
67
+ }
68
+ function _e({
69
+ id: o,
70
+ cells: c,
71
+ options: l = {
15
72
  paginationType: "dots",
16
73
  showControls: !0,
17
74
  controlArrowSize: 48,
@@ -27,176 +84,153 @@ function we({
27
84
  slideAspectRatio: "4/2",
28
85
  slideGap: 1.5,
29
86
  cellsPerSlide: 1,
87
+ breakpoints: {
88
+ one: { width: 600, cellsPerSlide: 1 },
89
+ two: { width: 800, cellsPerSlide: 2 },
90
+ three: { width: 1024, cellsPerSlide: 3 },
91
+ four: { width: 1750, cellsPerSlide: 4 }
92
+ },
30
93
  cellAspectRatio: "4/2",
31
94
  cellsPosition: "center",
32
95
  wrapAround: !0
33
96
  }
34
97
  }) {
35
- const h = i(`carousel-${L}`), I = i(null), c = i(null), R = i(null), p = i([...w]), $ = i(null), S = i(null), r = i(null), e = i(x), o = i(x), N = i("-50%"), [T, H] = m([]), [M, U] = m([]), [k, q] = m(0), [F, D] = m(!1);
36
- B(() => {
37
- const t = () => {
38
- P.matches ? e.current = {
39
- ...o.current,
40
- showControls: !1,
41
- showPagination: !1,
42
- cellsPerSlide: 1,
43
- cellsPosition: o.current.wrapAround ? "center" : "flex-start",
44
- gutterSize: 10
45
- } : b.matches ? o.current.cellsPerSlide !== 1 ? e.current = {
46
- ...o.current,
47
- cellsPerSlide: 2,
48
- showControls: !1,
49
- gutterSize: 10
50
- } : e.current = {
51
- ...o.current,
52
- showControls: !1,
53
- gutterSize: 10
54
- } : z.matches ? o.current.cellsPerSlide !== 1 && o.current.cellsPerSlide !== 2 ? e.current = {
55
- ...o.current,
56
- cellsPerSlide: 3,
57
- showControls: !1,
58
- gutterSize: 10
59
- } : e.current = {
60
- ...o.current,
61
- showControls: !1,
62
- gutterSize: 10
63
- } : E.matches ? o.current.showPagination ? e.current = {
64
- ...o.current,
65
- showControls: !1
66
- } : e.current = {
67
- ...o.current
68
- } : e.current = {
69
- ...o.current
98
+ const i = d(`carousel-${o}`), p = d(null), a = d(null), z = d(null), g = d([...c]), L = d(null), P = d(null), r = d(null), e = d(l), A = d(l), T = d("-50%"), [x, j] = v([]), [N, H] = v([]), [k, F] = v(0), [V, $] = v(!1);
99
+ U(() => {
100
+ const t = ae(A.current.breakpoints), n = () => {
101
+ e.current = {
102
+ ...A.current,
103
+ ...ue(A.current, t)
70
104
  };
71
105
  };
72
- t();
73
- const n = () => {
74
- q((s) => s + 1), t();
106
+ n();
107
+ const u = () => {
108
+ F((h) => h + 1), n();
75
109
  };
76
- return P.addEventListener("change", n), b.addEventListener("change", n), z.addEventListener("change", n), E.addEventListener("change", n), () => {
77
- P.removeEventListener("change", n), b.removeEventListener("change", n), z.removeEventListener("change", n), E.removeEventListener("change", n);
110
+ return t.forEach(({ mediaQuery: h }) => h.addEventListener("change", u)), () => {
111
+ t.forEach(({ mediaQuery: h }) => h.removeEventListener("change", u));
78
112
  };
79
113
  }, []);
80
- const O = u((t, n) => {
81
- const s = te(n, t);
82
- U([...s]);
83
- let _ = [];
84
- for (let f = 0; f <= s.length - 1; f++)
85
- _[f] = {
86
- ariaLabel: `${f + 1} of ${s.length}`,
87
- layout: s[f][0].layout || "",
114
+ const O = S((t, n) => {
115
+ const u = re(n, t);
116
+ H([...u]);
117
+ let h = [];
118
+ for (let w = 0; w <= u.length - 1; w++)
119
+ h[w] = {
120
+ ariaLabel: `${w + 1} of ${u.length}`,
121
+ layout: u[w][0].layout || "",
88
122
  cells: [
89
- ...s[f]
123
+ ...u[w]
90
124
  ]
91
125
  };
92
- const C = [..._], A = [..._], Y = C.slice(-1), Z = C.slice(0);
93
- return A.push(Z[0]), A.unshift(Y[0]), e.current.wrapAround && t.length > n ? A : C;
94
- }, []), d = u(() => {
126
+ const E = [...h], I = [...h], J = E.slice(-1), X = E.slice(0);
127
+ return I.push(X[0]), I.unshift(J[0]), e.current.wrapAround && t.length > n ? I : E;
128
+ }, []), m = S(() => {
95
129
  e.current.autoplay && r.current && r.current.clearTimer();
96
- }, []), W = u((t) => {
97
- d();
130
+ }, []), W = S((t) => {
131
+ m();
98
132
  const n = t.key;
99
133
  n === "ArrowLeft" ? (t.preventDefault(), r.current && r.current.determineScrollAction(-1)) : n === "ArrowRight" && (t.preventDefault(), r.current && r.current.determineScrollAction(1));
100
- }, [d]), J = u(() => {
101
- d(), c.current !== null && c.current.addEventListener("scrollend", () => {
134
+ }, [m]), q = S(() => {
135
+ m(), a.current !== null && a.current.addEventListener("scrollend", () => {
102
136
  r.current && r.current.handleScrollEnd();
103
137
  }, { once: !0 });
104
- }, [d]), v = u(() => {
105
- d(), c.current !== null && c.current.addEventListener("scrollend", () => {
106
- r.current && r.current.handleScrollEnd(), c.current && c.current.addEventListener("scroll", v, { once: !0 });
138
+ }, [m]), C = S(() => {
139
+ m(), a.current !== null && a.current.addEventListener("scrollend", () => {
140
+ r.current && r.current.handleScrollEnd(), a.current && a.current.addEventListener("scroll", C, { once: !0 });
107
141
  }, { once: !0 });
108
- }, [d]), Q = () => {
142
+ }, [m]), Q = () => {
109
143
  var t;
110
144
  (t = r.current) == null || t.destroy();
111
- }, y = u(() => {
145
+ }, b = S(() => {
112
146
  //! make sure class is only instantiated once because of reacts
113
147
  //! "strict" mode double do hocus pocus
114
148
  var t, n;
115
- r.current !== null && k > 0 && ((n = (t = r.current).destroy) == null || n.call(t), r.current = null), D(!1), r.current = new ne({
116
- carouselEl: I.current,
117
- scrollerEl: c.current,
118
- paginationEl: R.current,
119
- cells: p.current,
149
+ r.current !== null && k > 0 && ((n = (t = r.current).destroy) == null || n.call(t), r.current = null), $(!1), r.current = new te({
150
+ carouselEl: p.current,
151
+ scrollerEl: a.current,
152
+ paginationEl: z.current,
153
+ cells: g.current,
120
154
  navBtnEls: {
121
- next: $.current,
122
- previous: S.current
155
+ next: L.current,
156
+ previous: P.current
123
157
  },
124
- id: h.current,
158
+ id: i.current,
125
159
  options: {
126
160
  autoplay: e.current.autoplay,
127
- wrapAround: e.current.wrapAround && p.current.length > (e.current.cellsPerSlide || 1),
161
+ wrapAround: e.current.wrapAround && g.current.length > (e.current.cellsPerSlide || 1),
128
162
  showPagination: e.current.showPagination,
129
163
  delay: e.current.autoplayDelay,
130
164
  slideGutterSize: e.current.gutterSize,
131
165
  slideAspectRatio: e.current.slideAspectRatio,
132
- showControls: e.current.showControls && p.current.length > (e.current.cellsPerSlide || 1),
166
+ showControls: e.current.showControls && g.current.length > (e.current.cellsPerSlide || 1),
133
167
  cellsPerSlide: e.current.cellsPerSlide
134
168
  }
135
- }), D(!0);
136
- }, [k]), V = u(() => {
137
- c.current && c.current.addEventListener("scroll", v, { once: !0 });
138
- }, [v]), G = () => {
169
+ }), $(!0);
170
+ }, [k]), M = S(() => {
171
+ a.current && a.current.addEventListener("scroll", C, { once: !0 });
172
+ }, [C]), D = () => {
139
173
  var t;
140
- return ((t = c.current) == null ? void 0 : t.querySelectorAll("[data-index]").length) ?? 0;
141
- }, K = u(() => {
142
- const t = O(p.current, e.current.cellsPerSlide ?? 1);
143
- H(t);
174
+ return ((t = a.current) == null ? void 0 : t.querySelectorAll("[data-index]").length) ?? 0;
175
+ }, B = S(() => {
176
+ const t = O(g.current, e.current.cellsPerSlide ?? 1);
177
+ j(t);
144
178
  const n = t.length;
145
- if (p.current.length > (e.current.cellsPerSlide ?? 1)) {
146
- let s = setInterval(() => {
147
- c.current !== null && G() >= n && (S.current !== null && e.current.showControls || !e.current.showControls) && (clearInterval(s), V(), y());
179
+ if (g.current.length > (e.current.cellsPerSlide ?? 1)) {
180
+ let u = setInterval(() => {
181
+ a.current !== null && D() >= n && (P.current !== null && e.current.showControls || !e.current.showControls) && (clearInterval(u), M(), b());
148
182
  }, 100);
149
183
  } else {
150
- let s = setInterval(() => {
151
- c.current !== null && G() >= n && (clearInterval(s), y());
184
+ let u = setInterval(() => {
185
+ a.current !== null && D() >= n && (clearInterval(u), b());
152
186
  }, 100);
153
187
  }
154
- }, [O, V, y]);
155
- B(() => {
188
+ }, [O, M, b]);
189
+ U(() => {
156
190
  if (e.current !== null) {
157
191
  if (e.current.showControls) {
158
192
  let t = 0;
159
- e.current.showPagination && (t = t + 25), e.current.showScrollbar && (t = t + 6), N.current = `calc(-50% - ${t}px)`;
193
+ e.current.showPagination && (t = t + 25), e.current.showScrollbar && (t = t + 6), T.current = `calc(-50% - ${t}px)`;
160
194
  }
161
- K();
195
+ B();
162
196
  }
163
197
  return () => {
164
198
  Q();
165
199
  };
166
- }, [K, e]);
167
- const X = () => w.length <= (e.current.cellsPerSlide ?? 1) ? "0" : e.current.wrapAround ? `${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%` : `0 ${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%`;
168
- return /* @__PURE__ */ l(ee, { children: e.current !== null && /* @__PURE__ */ j(
200
+ }, [B, e]);
201
+ const Z = () => c.length <= (e.current.cellsPerSlide ?? 1) ? "0" : e.current.wrapAround ? `${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%` : `0 ${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%`;
202
+ return /* @__PURE__ */ s(Y, { children: e.current !== null && /* @__PURE__ */ K(
169
203
  "div",
170
204
  {
171
205
  "aria-label": e.current.title,
172
206
  "aria-roledescription": "carousel",
173
- className: a.carousel,
174
- id: h.current,
175
- ref: I,
207
+ className: f.carousel,
208
+ id: i.current,
209
+ ref: p,
176
210
  role: "region",
177
211
  style: {
178
- "--_carousel-gutters": X(),
212
+ "--_carousel-gutters": Z(),
179
213
  "--_slide-aspect-ratio": e.current.slideAspectRatio,
180
214
  "--_cell-aspect-ratio": e.current.cellAspectRatio,
181
215
  "--_slide-cell-size": `${100 / (e.current.cellsPerSlide ?? 1)}%`,
182
216
  "--_cells-position": e.current.cellsPosition,
183
217
  "--_control-btns-offset-x": `${e.current.controlButtonsOffset ?? 0}rem`,
184
218
  "--_slide-gap": `${e.current.slideGap ?? 0}rem`,
185
- "--_controls-transform": N.current
219
+ "--_controls-transform": T.current
186
220
  },
187
221
  tabIndex: -1,
188
222
  onKeyDown: W,
189
223
  children: [
190
- /* @__PURE__ */ l(
224
+ /* @__PURE__ */ s(
191
225
  "ol",
192
226
  {
193
227
  "aria-label": "Items Scroller",
194
228
  "aria-live": "polite",
195
- className: a.carousel__scroller,
229
+ className: f.carousel__scroller,
196
230
  "data-scrollbar": e.current.showScrollbar,
197
- ref: c,
231
+ ref: a,
198
232
  role: "group",
199
- style: { opacity: F ? 1 : 0 },
233
+ style: { opacity: V ? 1 : 0 },
200
234
  tabIndex: 0,
201
235
  onMouseEnter: () => {
202
236
  e.current.autoplay && r.current !== null && r.current.clearTimer();
@@ -204,45 +238,45 @@ function we({
204
238
  onMouseLeave: () => {
205
239
  e.current.autoplay && r.current !== null && r.current.startTimer();
206
240
  },
207
- onTouchStart: J,
208
- children: /* @__PURE__ */ l(
209
- re,
241
+ onTouchStart: q,
242
+ children: /* @__PURE__ */ s(
243
+ ee,
210
244
  {
211
- fallback: /* @__PURE__ */ l(
245
+ fallback: /* @__PURE__ */ s(
212
246
  "li",
213
247
  {
214
- className: g([a["carousel__loading-slide"], "carousel__loading-slide"]),
248
+ className: _([f["carousel__loading-slide"], "carousel__loading-slide"]),
215
249
  role: "presentation",
216
250
  style: { aspectRatio: "var(--_slide-aspect-ratio)", width: "100%" },
217
- children: /* @__PURE__ */ l(ce, {})
251
+ children: /* @__PURE__ */ s(le, {})
218
252
  }
219
253
  ),
220
- children: T.length > 0 && T.map((t, n) => /* @__PURE__ */ l(
221
- le,
254
+ children: x.length > 0 && x.map((t, n) => /* @__PURE__ */ s(
255
+ ne,
222
256
  {
223
257
  currentIndex: e.current.wrapAround ? 1 : 0,
224
258
  index: n,
225
259
  slide: { ...t, ariaLabel: t.ariaLabel || "" },
226
260
  variableHeight: e.current.variableHeight
227
261
  },
228
- `carousel${L}-slide${n}`
262
+ `carousel${o}-slide${n}`
229
263
  ))
230
264
  }
231
265
  )
232
266
  }
233
267
  ),
234
- e.current.showControls && w.length > (e.current.cellsPerSlide ?? 1) && /* @__PURE__ */ j("div", { className: a["carousel-controls"], children: [
235
- /* @__PURE__ */ l(
268
+ e.current.showControls && c.length > (e.current.cellsPerSlide ?? 1) && /* @__PURE__ */ K("div", { className: f["carousel-controls"], children: [
269
+ /* @__PURE__ */ s(
236
270
  "button",
237
271
  {
238
- "aria-controls": h.current,
272
+ "aria-controls": i.current,
239
273
  "aria-label": "Previous Item",
240
- className: g([
241
- a["carousel-controls__btn"],
242
- a["carousel-controls__previous"],
274
+ className: _([
275
+ f["carousel-controls__btn"],
276
+ f["carousel-controls__previous"],
243
277
  "carousel-controls__previous"
244
278
  ]),
245
- ref: S,
279
+ ref: P,
246
280
  title: "Previous Item",
247
281
  type: "button",
248
282
  onClick: () => {
@@ -254,16 +288,16 @@ function we({
254
288
  onMouseLeave: () => {
255
289
  e.current.autoplay && r.current !== null && r.current.startTimer();
256
290
  },
257
- children: /* @__PURE__ */ l("i", { "aria-hidden": "true", children: /* @__PURE__ */ l(oe, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
291
+ children: /* @__PURE__ */ s("i", { "aria-hidden": "true", children: /* @__PURE__ */ s(oe, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
258
292
  }
259
293
  ),
260
- /* @__PURE__ */ l(
294
+ /* @__PURE__ */ s(
261
295
  "button",
262
296
  {
263
- "aria-controls": h.current,
297
+ "aria-controls": i.current,
264
298
  "aria-label": "Next Item",
265
- className: g([a["carousel-controls__btn"], a["carousel-controls__next"], "carousel-controls__next"]),
266
- ref: $,
299
+ className: _([f["carousel-controls__btn"], f["carousel-controls__next"], "carousel-controls__next"]),
300
+ ref: L,
267
301
  title: "Next Item",
268
302
  type: "button",
269
303
  onClick: () => {
@@ -275,27 +309,27 @@ function we({
275
309
  onMouseLeave: () => {
276
310
  e.current.autoplay && r.current !== null && r.current.startTimer();
277
311
  },
278
- children: /* @__PURE__ */ l("i", { "aria-hidden": "true", children: /* @__PURE__ */ l(se, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
312
+ children: /* @__PURE__ */ s("i", { "aria-hidden": "true", children: /* @__PURE__ */ s(ce, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
279
313
  }
280
314
  )
281
315
  ] }),
282
- e.current.showPagination && M.length > 1 && /* @__PURE__ */ l("div", { className: [a["carousel-nav"], "carousel-nav"].join(" "), children: /* @__PURE__ */ l("ol", { className: a["carousel-nav__list"], ref: R, children: M.map((t, n) => /* @__PURE__ */ l(
316
+ e.current.showPagination && N.length > 1 && /* @__PURE__ */ s("div", { className: [f["carousel-nav"], "carousel-nav"].join(" "), children: /* @__PURE__ */ s("ol", { className: f["carousel-nav__list"], ref: z, children: N.map((t, n) => /* @__PURE__ */ s(
283
317
  "li",
284
318
  {
285
- className: g([a["carousel-nav__item"], "carousel-nav__item"]),
319
+ className: _([f["carousel-nav__item"], "carousel-nav__item"]),
286
320
  "data-current": n === 0 ? "" : void 0,
287
321
  title: `Navigate to slide ${n + 1}`,
288
322
  onClick: () => {
289
323
  r.current && r.current.navigateToIndex(n);
290
324
  }
291
325
  },
292
- `carousel${h}-nav-${n}`
326
+ `carousel${i}-nav-${n}`
293
327
  )) }) })
294
328
  ]
295
329
  }
296
330
  ) });
297
331
  }
298
332
  export {
299
- we as Carousel,
300
- we as default
333
+ _e as Carousel,
334
+ _e as default
301
335
  };
@@ -1,3 +1,4 @@
1
+ import { CarouselBreakpoints } from '../types';
1
2
  export declare const getCarouselOptions: (type: "BANNER" | "FEATURED" | "TWO_COLUMN", title: string, env?: string) => {
2
3
  paginationType: string;
3
4
  showControls: boolean;
@@ -17,4 +18,5 @@ export declare const getCarouselOptions: (type: "BANNER" | "FEATURED" | "TWO_COL
17
18
  cellAspectRatio: number | string;
18
19
  cellsPosition: string;
19
20
  wrapAround: boolean;
21
+ breakpoints: CarouselBreakpoints;
20
22
  } | {};
@@ -1,6 +1,11 @@
1
- const a = (t, o, l = "local") => {
1
+ const o = {
2
+ one: { width: 600, cellsPerSlide: 1 },
3
+ two: { width: 800, cellsPerSlide: 2 },
4
+ three: { width: 1024, cellsPerSlide: 3 },
5
+ four: { width: 1750, cellsPerSlide: 4 }
6
+ }, a = (l, t, s = "local") => {
2
7
  let e = {};
3
- return t === "BANNER" ? e = {
8
+ return l === "BANNER" ? e = {
4
9
  paginationType: "dots",
5
10
  showControls: !0,
6
11
  controlArrowSize: 72,
@@ -8,18 +13,19 @@ const a = (t, o, l = "local") => {
8
13
  showScrollbar: !1,
9
14
  startIndex: 0,
10
15
  variableHeight: !1,
11
- title: o,
12
- autoplay: l !== "local",
16
+ title: t,
17
+ autoplay: s !== "local",
13
18
  autoplayDelay: 6e3,
14
19
  showPagination: !0,
15
20
  gutterSize: 0,
16
- slideAspectRatio: 2.011764705882353,
21
+ slideAspectRatio: 1710 / 850,
17
22
  slideGap: 1.5,
18
23
  cellsPerSlide: 1,
19
- cellAspectRatio: 2.011764705882353,
24
+ cellAspectRatio: 1710 / 850,
20
25
  cellsPosition: "center",
21
- wrapAround: !0
22
- } : t === "FEATURED" ? e = {
26
+ wrapAround: !0,
27
+ breakpoints: { ...o }
28
+ } : l === "FEATURED" ? e = {
23
29
  paginationType: "dots",
24
30
  showControls: !0,
25
31
  controlArrowSize: 64,
@@ -27,7 +33,7 @@ const a = (t, o, l = "local") => {
27
33
  showScrollbar: !1,
28
34
  startIndex: 0,
29
35
  variableHeight: !1,
30
- title: o,
36
+ title: t,
31
37
  autoplay: !1,
32
38
  autoplayDelay: 6e3,
33
39
  showPagination: !1,
@@ -35,10 +41,11 @@ const a = (t, o, l = "local") => {
35
41
  slideAspectRatio: "",
36
42
  slideGap: 2.5,
37
43
  cellsPerSlide: 4,
38
- cellAspectRatio: 0.6561461794019934,
44
+ cellAspectRatio: 395 / 602,
39
45
  cellsPosition: "flex-start",
40
- wrapAround: !1
41
- } : t === "TWO_COLUMN" && (e = {
46
+ wrapAround: !1,
47
+ breakpoints: { ...o }
48
+ } : l === "TWO_COLUMN" && (e = {
42
49
  paginationType: "dots",
43
50
  showControls: !0,
44
51
  controlArrowSize: 64,
@@ -46,17 +53,18 @@ const a = (t, o, l = "local") => {
46
53
  showScrollbar: !1,
47
54
  startIndex: 0,
48
55
  variableHeight: !1,
49
- title: o,
56
+ title: t,
50
57
  autoplay: !1,
51
58
  autoplayDelay: 6e3,
52
59
  showPagination: !0,
53
60
  gutterSize: 0,
54
- slideAspectRatio: 2.6666666666666665,
61
+ slideAspectRatio: 4 / 1.5,
55
62
  slideGap: 1.5,
56
63
  cellsPerSlide: 1,
57
- cellAspectRatio: 2.6666666666666665,
64
+ cellAspectRatio: 4 / 1.5,
58
65
  cellsPosition: "center",
59
- wrapAround: !1
66
+ wrapAround: !1,
67
+ breakpoints: { ...o }
60
68
  }), e;
61
69
  };
62
70
  export {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.11-alpha.0",
2
+ "version": "2.0.11-alpha.1",
3
3
  "name": "@scrippsproduct/networks-ui-library",
4
4
  "description": "React Component Library for use in Scripps Networks external applications",
5
5
  "author": {