@scrippsproduct/networks-ui-library 1.0.23 → 1.1.0-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.
- package/dist/{Form.module-DbpB9u1l.mjs → Form.module-Cd8qH2rj.mjs} +1 -1
- package/dist/{ResultsTable.module-nTlGw9Lh.mjs → ResultsTable.module-B7M9y7hd.mjs} +1 -5
- package/dist/_commonjsHelpers-C6fGbg64.mjs +6 -0
- package/dist/{add-FrnMPwwO.mjs → add-UWUc_nrO.mjs} +2 -2
- package/dist/{addMonths-BDf46gmB.mjs → addMonths-FatsTLmU.mjs} +1 -1
- package/dist/assets/ActionButton.css +1 -1
- package/dist/assets/AdBlock.css +1 -1
- package/dist/assets/CarouselSlide.css +1 -1
- package/dist/assets/ChannelSearch.css +1 -1
- package/dist/assets/DateNavigation.css +1 -1
- package/dist/assets/DatePicker.css +1 -1
- package/dist/assets/DeviceAndPlatformLists.css +1 -1
- package/dist/assets/EqualSizeFlexRow.css +1 -1
- package/dist/assets/EqualSizeGrid.css +1 -1
- package/dist/assets/FeaturedList.css +1 -1
- package/dist/assets/Figure.css +1 -1
- package/dist/assets/FindUs.css +1 -1
- package/dist/assets/Form.css +1 -1
- package/dist/assets/GridList.css +1 -1
- package/dist/assets/IONShowHero.css +1 -1
- package/dist/assets/ImageCard.css +1 -1
- package/dist/assets/LogoListItem.css +1 -1
- package/dist/assets/ModalContainer.css +1 -1
- package/dist/assets/PageHero.css +1 -1
- package/dist/assets/ProgramAirdate.css +1 -1
- package/dist/assets/PromotionBlock.css +1 -1
- package/dist/assets/ResultsTable.css +1 -1
- package/dist/{chevron-left-DmvQntvu.mjs → chevron-left-DRvpaLmK.mjs} +1 -1
- package/dist/{chevron-right-CaAz6ISN.mjs → chevron-right-C8yCnmfx.mjs} +1 -1
- package/dist/components/ActionButton/ActionButton.d.ts +20 -1
- package/dist/components/ActionButton/ActionButton.js +36 -36
- package/dist/components/ActionButton/index.d.ts +2 -1
- package/dist/components/AirDateFormatter/AirDateFormatter.js +3 -3
- package/dist/components/BasicGridModule/BasicGridModule.js +25 -25
- package/dist/components/Carousel/Carousel.d.ts +7 -24
- package/dist/components/Carousel/Carousel.js +109 -109
- package/dist/components/Carousel/CarouselUtils.class.d.ts +16 -28
- package/dist/components/Carousel/CarouselUtils.class.js +85 -55
- package/dist/components/CarouselSlide/CarouselSlide.d.ts +8 -6
- package/dist/components/CarouselSlide/CarouselSlide.js +90 -26
- package/dist/components/CarouselSlide/index.d.ts +2 -1
- package/dist/components/CarouselSlide/slide-layouts/Empty/Empty.d.ts +1 -1
- package/dist/components/CarouselSlide/slide-layouts/Empty/Empty.js +3 -4
- package/dist/components/CarouselSlide/slide-layouts/Empty/index.d.ts +2 -1
- package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.d.ts +2 -2
- package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.js +10 -11
- package/dist/components/CarouselSlide/slide-layouts/Figure/index.d.ts +2 -1
- package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.d.ts +2 -2
- package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.js +9 -10
- package/dist/components/CarouselSlide/slide-layouts/Text/index.d.ts +2 -1
- package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
- package/dist/components/CastInfoLayout/CastInfoLayout.js +1 -1
- package/dist/components/ChannelSearch/ChannelSearch.js +12 -12
- package/dist/components/Concat/Concat.js +1 -1
- package/dist/components/CtaBlock/CtaBlock.js +2 -2
- package/dist/components/CustomDataList/CustomDataList.js +44 -47
- package/dist/components/CustomSelect/CustomSelect.js +5 -5
- package/dist/components/DateNavigation/DateNavigation.js +7 -8
- package/dist/components/DatePicker/DatePicker.js +2527 -2452
- package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.js +1 -1
- package/dist/components/DrawerNavigation/DrawerNavigation.js +27 -29
- package/dist/components/ErrorHandler/ErrorHandler.js +1 -1
- package/dist/components/FeaturedList/FeaturedList.js +7 -7
- package/dist/components/Figure/Figure.js +1 -1
- package/dist/components/FindUs/FindUs.js +6 -6
- package/dist/components/GenericList/GenericList.js +1 -1
- package/dist/components/GetAirdateWrapper/GetAirdateWrapper.js +6 -6
- package/dist/components/ImageCard/ImageCard.js +6 -6
- package/dist/components/ImageCard/ImageCardCore.js +1 -1
- package/dist/components/InfoPanel/InfoPanel.js +15 -16
- package/dist/components/InlineNavigation/InlineNavigation.js +6 -7
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/InstructionsList/InstructionsList.js +1 -1
- package/dist/components/Loading/Loading.js +5 -8
- package/dist/components/ModalContainer/ModalContainer.js +41 -44
- package/dist/components/Overlay/Overlay.js +17 -20
- package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.js +9 -9
- package/dist/components/PromotionBlock/PromotionBlock.js +15 -17
- package/dist/components/PromotionsRowModule/PromotionsRowModule.js +8 -8
- package/dist/components/ResultsTable/ResultsTable.js +7 -7
- package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
- package/dist/components/ResultsTableHeader/ResultsTableHeader.js +1 -1
- package/dist/components/ScheduleLayout/ScheduleLayout.js +2 -2
- package/dist/components/ScheduleList/ScheduleList.js +17 -17
- package/dist/components/ScheduleList/schedule-list-items/MovieItem.js +10 -10
- package/dist/components/ScheduleList/schedule-list-items/SeriesItem.js +8 -8
- package/dist/components/ScheduleList/schedule-list-items/SportsItem.js +8 -8
- package/dist/components/SectionedContent/SectionedContent.js +13 -16
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
- package/dist/components/ShowAboutLayout/ShowAboutLayout.js +24 -25
- package/dist/components/SocialLinks/SocialLinks.js +3 -3
- package/dist/components/SocialShareBlock/SocialShareBlock.js +8 -8
- package/dist/components/StringList/StringList.js +1 -1
- package/dist/components/TabContent/TabContent.js +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/UpcomingList/UpcomingList.js +8 -8
- package/dist/containers/NowPlayingContainer.js +10 -10
- package/dist/{facebook-osmzgL7R.mjs → facebook-HCcA1M1m.mjs} +1 -1
- package/dist/{format-plq8pBNY.mjs → format-YhWt2D8M.mjs} +78 -12
- package/dist/hooks/useGetSchedule.js +3 -3
- package/dist/hooks/useGetUpcoming.js +2 -2
- package/dist/{index-C8O1hjfH.mjs → index-0wieGV50.mjs} +0 -1
- package/dist/{index-DC7FmJPK.mjs → index-C-kn9Zhn.mjs} +7134 -7069
- package/dist/{index-CZzwT3Oj.mjs → index-DC2JJV3a.mjs} +246 -241
- package/dist/index-VjANCDXC.mjs +1873 -0
- package/dist/settings.d.ts +4 -3
- package/dist/{sub-CkNH5u-l.mjs → sub-CoUmnfhv.mjs} +2 -2
- package/dist/{subMonths-nbU1oDhB.mjs → subMonths-BtMU5A9u.mjs} +1 -1
- package/dist/{triangle-D0AHL9lB.mjs → triangle-PcCcGXjr.mjs} +1 -1
- package/dist/types.d.js +27 -0
- package/dist/utils/analytics.js +434 -423
- package/dist/utils/date-helpers.js +4 -4
- package/dist/utils/getFeaturedList.js +3 -3
- package/dist/utils/getOnNowProgram.js +3 -3
- package/dist/utils/getUpcomingPrograms.js +2 -2
- package/dist/{x-D8_C2o-U.mjs → x-C-QzJ-qD.mjs} +1 -1
- package/package.json +27 -24
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
- package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.stories.d.ts +0 -34
- package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.stories.js +0 -105
- package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.stories.d.ts +0 -19
- package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.stories.js +0 -35
- package/dist/index-B0ARwqly.mjs +0 -1818
- /package/dist/{networks-ui.d.ts → secl-ui.d.ts} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { subscribe as w, unsubscribe as y, publish as
|
|
4
|
-
import { classes as
|
|
5
|
-
import '../../assets/ActionButton.css';const
|
|
6
|
-
"action-btn": "_action-
|
|
7
|
-
"action-btn--small": "_action-btn--
|
|
8
|
-
"action-btn--large": "_action-btn--
|
|
9
|
-
"action-btn--primary": "_action-btn--
|
|
10
|
-
"action-btn--action": "_action-btn--
|
|
11
|
-
"action-btn--info": "_action-btn--
|
|
12
|
-
"action-btn--danger": "_action-btn--
|
|
13
|
-
"dots-pulse": "_dots-
|
|
14
|
-
scale:
|
|
1
|
+
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useEffect as H } from "react";
|
|
3
|
+
import { subscribe as w, unsubscribe as y, publish as k } from "../../utils/events.js";
|
|
4
|
+
import { classes as x } from "../../utils/helpers.js";
|
|
5
|
+
import '../../assets/ActionButton.css';const N = "_scale_zgv2f_1", n = {
|
|
6
|
+
"action-btn": "_action-btn_zgv2f_1",
|
|
7
|
+
"action-btn--small": "_action-btn--small_zgv2f_31",
|
|
8
|
+
"action-btn--large": "_action-btn--large_zgv2f_38",
|
|
9
|
+
"action-btn--primary": "_action-btn--primary_zgv2f_45",
|
|
10
|
+
"action-btn--action": "_action-btn--action_zgv2f_54",
|
|
11
|
+
"action-btn--info": "_action-btn--info_zgv2f_63",
|
|
12
|
+
"action-btn--danger": "_action-btn--danger_zgv2f_72",
|
|
13
|
+
"dots-pulse": "_dots-pulse_zgv2f_97",
|
|
14
|
+
scale: N
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function $({
|
|
17
17
|
label: l,
|
|
18
18
|
type: c = "button",
|
|
19
|
-
onClick:
|
|
19
|
+
onClick: d = () => {
|
|
20
20
|
},
|
|
21
21
|
varient: r = "",
|
|
22
22
|
size: e = "",
|
|
@@ -28,42 +28,42 @@ function A({
|
|
|
28
28
|
borderColor: "",
|
|
29
29
|
borderHoverColor: ""
|
|
30
30
|
},
|
|
31
|
-
disabled:
|
|
31
|
+
disabled: s,
|
|
32
32
|
classname: _ = "",
|
|
33
|
-
...
|
|
33
|
+
...g
|
|
34
34
|
}) {
|
|
35
|
-
const [a,
|
|
35
|
+
const [a, i] = z("idle"), p = r === "" ? "" : `action-btn--${r}`, v = e === "" ? "" : `action-btn--${e}`, f = o.bgColor !== "" ? {
|
|
36
36
|
"--button-bg-color": o.bgColor,
|
|
37
37
|
"--button-hover-bg-color": o.bgHoverColor === "" ? o.bgColor : o.bgHoverColor,
|
|
38
38
|
"--button-color": o.color,
|
|
39
39
|
"--button-hover-color": o.hoverColor === "" ? o.color : o.hoverColor,
|
|
40
40
|
"--button-border-color": o.borderColor === "" ? o.bgColor : o.borderColor,
|
|
41
41
|
"--button-hover-border-color": o.borderHoverColor === "" && o.borderColor === "" ? o.bgColor : o.borderHoverColor
|
|
42
|
-
} : null,
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
42
|
+
} : null, h = () => {
|
|
43
|
+
i("idle");
|
|
44
|
+
}, u = (C) => {
|
|
45
|
+
d(C), i("waiting"), k("scripps:actionbtn:clicked");
|
|
46
46
|
};
|
|
47
|
-
return H(() => (w("scripps:action:completed",
|
|
47
|
+
return H(() => (w("scripps:action:completed", h), () => {
|
|
48
48
|
y("scripps:action:completed");
|
|
49
|
-
}), []), /* @__PURE__ */
|
|
49
|
+
}), []), /* @__PURE__ */ b(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
|
|
53
|
-
className: N([
|
|
52
|
+
className: x([
|
|
54
53
|
n["action-btn"],
|
|
55
54
|
"action-btn",
|
|
56
55
|
_,
|
|
57
|
-
r === "" ? "" : n[
|
|
58
|
-
e === "" ? "" : n[
|
|
56
|
+
r === "" ? "" : n[p],
|
|
57
|
+
e === "" ? "" : n[v]
|
|
59
58
|
]),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
disabled: a === "waiting" || s,
|
|
60
|
+
style: f || void 0,
|
|
61
|
+
type: c,
|
|
62
|
+
onClick: u,
|
|
63
|
+
...g,
|
|
64
64
|
children: [
|
|
65
65
|
a !== "waiting" && /* @__PURE__ */ t("span", { className: n["action-btn__label"], children: l }),
|
|
66
|
-
a === "waiting" && /* @__PURE__ */
|
|
66
|
+
a === "waiting" && /* @__PURE__ */ b("div", { className: n["dots-pulse"], children: [
|
|
67
67
|
/* @__PURE__ */ t("span", {}),
|
|
68
68
|
/* @__PURE__ */ t("span", {}),
|
|
69
69
|
/* @__PURE__ */ t("span", {})
|
|
@@ -73,6 +73,6 @@ function A({
|
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
$ as ActionButton,
|
|
77
|
+
$ as default
|
|
78
78
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { ActionButton
|
|
1
|
+
export { ActionButton } from './ActionButton';
|
|
2
|
+
export { ActionButton as default } from './ActionButton';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { classes as i } from "../../utils/helpers.js";
|
|
4
|
-
import { s as $ } from "../../sub-
|
|
5
|
-
import { f as m } from "../../format-
|
|
6
|
-
import { a as u } from "../../add-
|
|
4
|
+
import { s as $ } from "../../sub-CoUmnfhv.mjs";
|
|
5
|
+
import { f as m } from "../../format-YhWt2D8M.mjs";
|
|
6
|
+
import { a as u } from "../../add-UWUc_nrO.mjs";
|
|
7
7
|
import '../../assets/AirDateFormatter.css';const d = {
|
|
8
8
|
"airdate-formatter__pipe": "_airdate-formatter__pipe_1ox2d_1",
|
|
9
9
|
"airdate-formatter__date": "_airdate-formatter__date_1ox2d_8",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as g, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsxs as g, Fragment as j, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r, useRef as p, useCallback as F, useEffect as y, createElement as G } from "react";
|
|
3
|
+
import { classes as O } from "../../utils/helpers.js";
|
|
4
|
+
import { blockLayoutsMap as P } from "../../settings.js";
|
|
5
|
+
import { EqualSizeGrid as _ } from "../EqualSizeGrid/EqualSizeGrid.js";
|
|
6
|
+
import { InfoPanel as q } from "../InfoPanel/InfoPanel.js";
|
|
7
7
|
import '../../assets/BasicGridModule.css';function T({
|
|
8
8
|
children: z,
|
|
9
9
|
gap: b = "1.5rem",
|
|
@@ -11,7 +11,7 @@ import '../../assets/BasicGridModule.css';function T({
|
|
|
11
11
|
classname: L = "",
|
|
12
12
|
title: d = "",
|
|
13
13
|
infoPanel: A,
|
|
14
|
-
itemComponent:
|
|
14
|
+
itemComponent: s = {
|
|
15
15
|
layout: "ImageCard",
|
|
16
16
|
props: {
|
|
17
17
|
fullCardClickable: !1
|
|
@@ -27,35 +27,35 @@ import '../../assets/BasicGridModule.css';function T({
|
|
|
27
27
|
customClicksHandler: I = null,
|
|
28
28
|
noAnimation: x = !1
|
|
29
29
|
}) {
|
|
30
|
-
const [
|
|
30
|
+
const [a, f] = r(!1), [C, B] = r({}), [m, R] = r(null), [v, c] = r("entering"), [M, N] = r(x ? null : !0), o = p("entering"), e = p(null), l = F(() => {
|
|
31
31
|
e.current.children[0].addEventListener("animationstart", () => {
|
|
32
|
-
console.log("animation started"), e.current.children[0].addEventListener("animationend",
|
|
33
|
-
}),
|
|
34
|
-
}, []),
|
|
35
|
-
t.type === "info-panel" && (
|
|
32
|
+
console.log("animation started"), e.current.children[0].addEventListener("animationend", l, { once: !0 });
|
|
33
|
+
}), o.current === "exiting" ? (c("entering"), o.current = "entering", f(!0)) : c("idle");
|
|
34
|
+
}, []), S = (t) => {
|
|
35
|
+
t.type === "info-panel" && (B(n.resourceList.find((i) => Number.parseInt(i.id, 10) === Number.parseInt(t.resourceId, 10))), N(!1), o.current = "exiting", c("exiting"));
|
|
36
36
|
};
|
|
37
37
|
return y(() => {
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
var t,
|
|
41
|
-
!
|
|
42
|
-
}, [
|
|
43
|
-
!
|
|
44
|
-
d !== "" && /* @__PURE__ */ u("h2", { className:
|
|
38
|
+
R(P.get(s.layout));
|
|
39
|
+
}, [s.layout]), y(() => {
|
|
40
|
+
var t, i, h;
|
|
41
|
+
!a && e.current !== null && ((t = e.current) != null && t.children, e.current.children.length && ((i = e.current.children[0]) == null || i.removeEventListener("animationend", l, { once: !0 }), (h = e.current.children[0]) == null || h.addEventListener("animationend", l, { once: !0 })));
|
|
42
|
+
}, [a, l]), /* @__PURE__ */ g(j, { children: [
|
|
43
|
+
!a && /* @__PURE__ */ g("basic-grid-module", { "data-state": v, "first-entry": M, ref: e, children: [
|
|
44
|
+
d !== "" && /* @__PURE__ */ u("h2", { className: O(["basic-grid-module__header", "h4"]), children: d }),
|
|
45
45
|
m !== null && /* @__PURE__ */ u(
|
|
46
|
-
|
|
46
|
+
_,
|
|
47
47
|
{
|
|
48
48
|
gap: b,
|
|
49
49
|
itemsPerRow: k,
|
|
50
50
|
classname: L,
|
|
51
51
|
children: E.map(
|
|
52
|
-
(t) => /* @__PURE__ */
|
|
52
|
+
(t) => /* @__PURE__ */ G(
|
|
53
53
|
m,
|
|
54
54
|
{
|
|
55
55
|
...t,
|
|
56
|
-
...
|
|
56
|
+
...s.props,
|
|
57
57
|
relatedResourceId: t.id,
|
|
58
|
-
handleClicks: I ??
|
|
58
|
+
handleClicks: I ?? S,
|
|
59
59
|
key: `grid-item-${Math.round(Math.random() * 1e7)}`
|
|
60
60
|
}
|
|
61
61
|
)
|
|
@@ -63,8 +63,8 @@ import '../../assets/BasicGridModule.css';function T({
|
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }),
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
a && n.layout && /* @__PURE__ */ u(
|
|
67
|
+
q,
|
|
68
68
|
{
|
|
69
69
|
className: "grid-info-panel",
|
|
70
70
|
onBackClicked: () => {
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
controlButtonsOffset: number;
|
|
9
|
-
showScrollbar: boolean;
|
|
10
|
-
startIndex: number;
|
|
11
|
-
variableHeight: boolean;
|
|
12
|
-
title: string;
|
|
13
|
-
autoplay: boolean;
|
|
14
|
-
autoplayDelay: number;
|
|
15
|
-
showPagination: boolean;
|
|
16
|
-
gutterSize: number;
|
|
17
|
-
slideAspectRatio: string;
|
|
18
|
-
slideGap: number;
|
|
19
|
-
cellsPerSlide: number;
|
|
20
|
-
cellAspectRatio: string;
|
|
21
|
-
cellsPosition: string;
|
|
22
|
-
wrapAround: boolean;
|
|
23
|
-
} | undefined;
|
|
24
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { CarouselCell, CarouselOptions } from '../../types';
|
|
2
|
+
type CarouselProps = {
|
|
3
|
+
id: string | number;
|
|
4
|
+
cells: CarouselCell[];
|
|
5
|
+
options?: CarouselOptions;
|
|
6
|
+
};
|
|
7
|
+
export declare function Carousel({ id, cells, options, }: CarouselProps): JSX.Element;
|
|
25
8
|
export default Carousel;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import { useRef as s, useState as
|
|
1
|
+
import { jsx as o, Fragment as Q, jsxs as K } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useState as C, useEffect as j, useCallback as i } from "react";
|
|
3
|
+
import { chunkArray as X, classes as A } from "../../utils/helpers.js";
|
|
3
4
|
import Y from "./CarouselUtils.class.js";
|
|
4
5
|
import { CarouselSlide as Z } from "../CarouselSlide/CarouselSlide.js";
|
|
5
|
-
import { chunkArray as ee, classes as _ } from "../../utils/helpers.js";
|
|
6
6
|
import { c as a } from "../../Carousel.module-DOrBKQEQ.mjs";
|
|
7
|
-
import { C as
|
|
8
|
-
import { C as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
id:
|
|
12
|
-
|
|
13
|
-
options:
|
|
7
|
+
import { C as ee } from "../../chevron-left-DRvpaLmK.mjs";
|
|
8
|
+
import { C as re } from "../../chevron-right-C8yCnmfx.mjs";
|
|
9
|
+
const _ = window.matchMedia("(width <= 600px)"), P = window.matchMedia("(width <= 800px"), b = window.matchMedia("(width <= 1024px"), z = window.matchMedia("(width <= 1280px");
|
|
10
|
+
function ue({
|
|
11
|
+
id: E,
|
|
12
|
+
cells: L,
|
|
13
|
+
options: x = {
|
|
14
14
|
paginationType: "dots",
|
|
15
15
|
showControls: !0,
|
|
16
16
|
controlArrowSize: 48,
|
|
@@ -31,18 +31,17 @@ function de({
|
|
|
31
31
|
wrapAround: !0
|
|
32
32
|
}
|
|
33
33
|
}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
B(() => {
|
|
34
|
+
const h = s(`carousel-${E}`), I = s(null), c = s(null), R = s(null), p = s([...L]), T = s(null), m = s(null), r = s(null), e = s(x), l = s(x), $ = s("-50%"), [N, B] = C([]), [M, G] = C([]), [k, H] = C(0);
|
|
35
|
+
j(() => {
|
|
37
36
|
const t = () => {
|
|
38
|
-
|
|
37
|
+
_.matches ? e.current = {
|
|
39
38
|
...l.current,
|
|
40
39
|
showControls: !1,
|
|
41
40
|
showPagination: !1,
|
|
42
41
|
cellsPerSlide: 1,
|
|
43
42
|
cellsPosition: l.current.wrapAround ? "center" : "flex-start",
|
|
44
43
|
gutterSize: 10
|
|
45
|
-
} :
|
|
44
|
+
} : P.matches ? l.current.cellsPerSlide !== 1 ? e.current = {
|
|
46
45
|
...l.current,
|
|
47
46
|
cellsPerSlide: 2,
|
|
48
47
|
showControls: !1,
|
|
@@ -51,7 +50,7 @@ function de({
|
|
|
51
50
|
...l.current,
|
|
52
51
|
showControls: !1,
|
|
53
52
|
gutterSize: 10
|
|
54
|
-
} :
|
|
53
|
+
} : b.matches ? l.current.cellsPerSlide !== 1 && l.current.cellsPerSlide !== 2 ? e.current = {
|
|
55
54
|
...l.current,
|
|
56
55
|
cellsPerSlide: 3,
|
|
57
56
|
showControls: !1,
|
|
@@ -60,7 +59,7 @@ function de({
|
|
|
60
59
|
...l.current,
|
|
61
60
|
showControls: !1,
|
|
62
61
|
gutterSize: 10
|
|
63
|
-
} :
|
|
62
|
+
} : z.matches ? l.current.showPagination ? e.current = {
|
|
64
63
|
...l.current,
|
|
65
64
|
showControls: !1
|
|
66
65
|
} : e.current = {
|
|
@@ -71,120 +70,122 @@ function de({
|
|
|
71
70
|
};
|
|
72
71
|
t();
|
|
73
72
|
const n = () => {
|
|
74
|
-
|
|
73
|
+
H((u) => u + 1), t();
|
|
75
74
|
};
|
|
76
|
-
return
|
|
77
|
-
|
|
75
|
+
return _.addEventListener("change", n), P.addEventListener("change", n), b.addEventListener("change", n), z.addEventListener("change", n), () => {
|
|
76
|
+
_.removeEventListener("change", n), P.removeEventListener("change", n), b.removeEventListener("change", n), z.removeEventListener("change", n);
|
|
78
77
|
};
|
|
79
78
|
}, []);
|
|
80
|
-
const
|
|
81
|
-
const u =
|
|
82
|
-
|
|
83
|
-
let
|
|
84
|
-
for (let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
const D = i((t, n) => {
|
|
80
|
+
const u = X(n, t);
|
|
81
|
+
G([...u]);
|
|
82
|
+
let S = [];
|
|
83
|
+
for (let f = 0; f <= u.length - 1; f++)
|
|
84
|
+
S[f] = {
|
|
85
|
+
ariaLabel: `${f + 1} of ${u.length}`,
|
|
86
|
+
layout: u[f][0].layout || "",
|
|
87
|
+
cells: [
|
|
88
|
+
...u[f]
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
const v = [...S], y = [...S], q = v.slice(-1), J = v.slice(0);
|
|
92
|
+
return y.push(J[0]), y.unshift(q[0]), e.current.wrapAround && t.length > n ? y : v;
|
|
93
|
+
}, []), d = i(() => {
|
|
94
|
+
e.current.autoplay && r.current && r.current.clearTimer();
|
|
95
|
+
}, []), U = i((t) => {
|
|
96
|
+
d();
|
|
97
97
|
const n = t.key;
|
|
98
|
-
n === "ArrowLeft" ? (t.preventDefault(), r.current.determineScrollAction(-1)) : n === "ArrowRight" && (t.preventDefault(), r.current.determineScrollAction(1));
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
r.current.handleScrollEnd();
|
|
98
|
+
n === "ArrowLeft" ? (t.preventDefault(), r.current && r.current.determineScrollAction(-1)) : n === "ArrowRight" && (t.preventDefault(), r.current && r.current.determineScrollAction(1));
|
|
99
|
+
}, [d]), F = i(() => {
|
|
100
|
+
d(), c.current !== null && c.current.addEventListener("scrollend", () => {
|
|
101
|
+
r.current && r.current.handleScrollEnd();
|
|
102
102
|
}, { once: !0 });
|
|
103
|
-
}, [
|
|
104
|
-
|
|
105
|
-
r.current.handleScrollEnd(),
|
|
103
|
+
}, [d]), w = i(() => {
|
|
104
|
+
d(), c.current !== null && c.current.addEventListener("scrollend", () => {
|
|
105
|
+
r.current && r.current.handleScrollEnd(), c.current && c.current.addEventListener("scroll", w, { once: !0 });
|
|
106
106
|
}, { once: !0 });
|
|
107
|
-
}, [
|
|
107
|
+
}, [d]), W = () => {
|
|
108
108
|
r.current && e.current.autoplay && r.current.clearTimer();
|
|
109
|
-
},
|
|
109
|
+
}, g = i(() => {
|
|
110
110
|
//! make sure class is only instantiated once because of reacts
|
|
111
111
|
//! "strict" mode double do hocus pocus
|
|
112
112
|
var t, n;
|
|
113
|
-
r.current !== null &&
|
|
114
|
-
carouselEl:
|
|
115
|
-
scrollerEl:
|
|
116
|
-
paginationEl:
|
|
117
|
-
|
|
113
|
+
r.current !== null && k > 0 && ((n = (t = r.current).clearTimer) == null || n.call(t), r.current = null), r.current = new Y({
|
|
114
|
+
carouselEl: I.current,
|
|
115
|
+
scrollerEl: c.current,
|
|
116
|
+
paginationEl: R.current,
|
|
117
|
+
cells: p.current,
|
|
118
118
|
navBtnEls: {
|
|
119
119
|
next: T.current,
|
|
120
|
-
previous:
|
|
120
|
+
previous: m.current
|
|
121
121
|
},
|
|
122
|
-
id:
|
|
122
|
+
id: h.current,
|
|
123
123
|
options: {
|
|
124
124
|
autoplay: e.current.autoplay,
|
|
125
|
-
wrapAround: e.current.wrapAround &&
|
|
125
|
+
wrapAround: e.current.wrapAround && p.current.length > (e.current.cellsPerSlide || 1),
|
|
126
126
|
showPagination: e.current.showPagination,
|
|
127
127
|
delay: e.current.autoplayDelay,
|
|
128
128
|
slideGutterSize: e.current.gutterSize,
|
|
129
129
|
slideAspectRatio: e.current.slideAspectRatio,
|
|
130
|
-
showControls: e.current.showControls &&
|
|
130
|
+
showControls: e.current.showControls && p.current.length > (e.current.cellsPerSlide || 1),
|
|
131
131
|
cellsPerSlide: e.current.cellsPerSlide
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
if (
|
|
134
|
+
}, [k]), O = i(() => {
|
|
135
|
+
c.current && c.current.addEventListener("scroll", w, { once: !0 });
|
|
136
|
+
}, [w]), V = i(() => {
|
|
137
|
+
if (B(D(p.current, e.current.cellsPerSlide ?? 1)), p.current.length > (e.current.cellsPerSlide ?? 1)) {
|
|
138
138
|
let t = setInterval(() => {
|
|
139
|
-
|
|
139
|
+
c.current !== null && (m.current !== null && e.current.showControls || !e.current.showControls) && (clearInterval(t), O(), g());
|
|
140
140
|
}, 100);
|
|
141
141
|
} else {
|
|
142
142
|
let t = setInterval(() => {
|
|
143
|
-
|
|
143
|
+
c.current !== null && (clearInterval(t), g());
|
|
144
144
|
}, 100);
|
|
145
145
|
}
|
|
146
|
-
}, [
|
|
147
|
-
return
|
|
146
|
+
}, [D, O, g]);
|
|
147
|
+
return j(() => {
|
|
148
148
|
if (e.current !== null) {
|
|
149
149
|
if (e.current.showControls) {
|
|
150
150
|
let t = 0;
|
|
151
|
-
e.current.showPagination && (t = t + 25), e.current.showScrollbar && (t = t + 6),
|
|
151
|
+
e.current.showPagination && (t = t + 25), e.current.showScrollbar && (t = t + 6), $.current = `calc(-50% - ${t}px)`;
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
V();
|
|
154
154
|
}
|
|
155
155
|
return () => {
|
|
156
|
-
|
|
156
|
+
W();
|
|
157
157
|
};
|
|
158
|
-
}, [
|
|
158
|
+
}, [V, e]), /* @__PURE__ */ o(Q, { children: e.current !== null && /* @__PURE__ */ K(
|
|
159
159
|
"div",
|
|
160
160
|
{
|
|
161
|
+
"aria-label": e.current.title,
|
|
162
|
+
"aria-roledescription": "carousel",
|
|
161
163
|
className: a.carousel,
|
|
162
|
-
id:
|
|
163
|
-
ref:
|
|
164
|
-
tabIndex: -1,
|
|
164
|
+
id: h.current,
|
|
165
|
+
ref: I,
|
|
165
166
|
role: "region",
|
|
166
|
-
"aria-roledescription": "carousel",
|
|
167
|
-
"aria-label": e.current.title,
|
|
168
|
-
onKeyDown: F,
|
|
169
167
|
style: {
|
|
170
|
-
"--_carousel-gutters": e.current.wrapAround ? `${e.current.gutterSize <= 25 ? e.current.gutterSize : 25}%` : `0 ${e.current.gutterSize <= 25 ? e.current.gutterSize : 25}%`,
|
|
168
|
+
"--_carousel-gutters": e.current.wrapAround ? `${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%` : `0 ${(e.current.gutterSize ?? 25) <= 25 ? e.current.gutterSize ?? 25 : 25}%`,
|
|
171
169
|
"--_slide-aspect-ratio": e.current.slideAspectRatio,
|
|
172
170
|
"--_cell-aspect-ratio": e.current.cellAspectRatio,
|
|
173
|
-
"--_slide-cell-size": `${100 / e.current.cellsPerSlide}%`,
|
|
171
|
+
"--_slide-cell-size": `${100 / (e.current.cellsPerSlide ?? 1)}%`,
|
|
174
172
|
"--_cells-position": e.current.cellsPosition,
|
|
175
|
-
"--_control-btns-offset-x": `${e.current.controlButtonsOffset}rem`,
|
|
176
|
-
"--_slide-gap": `${e.current.slideGap}rem`,
|
|
177
|
-
"--_controls-transform":
|
|
173
|
+
"--_control-btns-offset-x": `${e.current.controlButtonsOffset ?? 0}rem`,
|
|
174
|
+
"--_slide-gap": `${e.current.slideGap ?? 0}rem`,
|
|
175
|
+
"--_controls-transform": $.current
|
|
178
176
|
},
|
|
177
|
+
tabIndex: -1,
|
|
178
|
+
onKeyDown: U,
|
|
179
179
|
children: [
|
|
180
180
|
/* @__PURE__ */ o(
|
|
181
181
|
"ol",
|
|
182
182
|
{
|
|
183
|
+
"aria-label": "Items Scroller",
|
|
184
|
+
"aria-live": "polite",
|
|
183
185
|
className: a.carousel__scroller,
|
|
184
|
-
|
|
186
|
+
"data-scrollbar": e.current.showScrollbar,
|
|
187
|
+
ref: c,
|
|
185
188
|
role: "group",
|
|
186
|
-
"aria-label": "Items Scroller",
|
|
187
|
-
"aria-live": "Polite",
|
|
188
189
|
tabIndex: 0,
|
|
189
190
|
onMouseEnter: () => {
|
|
190
191
|
e.current.autoplay && r.current !== null && r.current.clearTimer();
|
|
@@ -192,32 +193,31 @@ function de({
|
|
|
192
193
|
onMouseLeave: () => {
|
|
193
194
|
e.current.autoplay && r.current !== null && r.current.startTimer();
|
|
194
195
|
},
|
|
195
|
-
onTouchStart:
|
|
196
|
-
|
|
197
|
-
children: M.length > 0 && M.map((t, n) => /* @__PURE__ */ o(
|
|
196
|
+
onTouchStart: F,
|
|
197
|
+
children: N.length > 0 && N.map((t, n) => /* @__PURE__ */ o(
|
|
198
198
|
Z,
|
|
199
199
|
{
|
|
200
|
-
slide: t,
|
|
201
|
-
index: n,
|
|
202
200
|
currentIndex: e.current.wrapAround ? 1 : 0,
|
|
201
|
+
index: n,
|
|
202
|
+
slide: { ...t, ariaLabel: t.ariaLabel || "" },
|
|
203
203
|
variableHeight: e.current.variableHeight
|
|
204
204
|
},
|
|
205
|
-
`carousel${
|
|
205
|
+
`carousel${E}-slide${n}`
|
|
206
206
|
))
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
|
-
e.current.showControls &&
|
|
209
|
+
e.current.showControls && L.length > (e.current.cellsPerSlide ?? 1) && /* @__PURE__ */ K("div", { className: a["carousel-controls"], children: [
|
|
210
210
|
/* @__PURE__ */ o(
|
|
211
211
|
"button",
|
|
212
212
|
{
|
|
213
|
-
|
|
214
|
-
ref: S,
|
|
215
|
-
title: "Previous Item",
|
|
216
|
-
className: _([a["carousel-controls__btn"], a["carousel-controls__previous"], "carousel-controls__previous"]),
|
|
217
|
-
"aria-controls": p.current,
|
|
213
|
+
"aria-controls": h.current,
|
|
218
214
|
"aria-label": "Previous Item",
|
|
215
|
+
className: A([a["carousel-controls__btn"], a["carousel-controls__previous"], "carousel-controls__previous"]),
|
|
216
|
+
ref: m,
|
|
217
|
+
title: "Previous Item",
|
|
218
|
+
type: "button",
|
|
219
219
|
onClick: () => {
|
|
220
|
-
r.current.determineScrollAction(-1);
|
|
220
|
+
r.current && r.current.determineScrollAction(-1);
|
|
221
221
|
},
|
|
222
222
|
onMouseEnter: () => {
|
|
223
223
|
e.current.autoplay && r.current !== null && r.current.clearTimer();
|
|
@@ -225,20 +225,20 @@ function de({
|
|
|
225
225
|
onMouseLeave: () => {
|
|
226
226
|
e.current.autoplay && r.current !== null && r.current.startTimer();
|
|
227
227
|
},
|
|
228
|
-
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
228
|
+
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(ee, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
|
|
229
229
|
}
|
|
230
230
|
),
|
|
231
231
|
/* @__PURE__ */ o(
|
|
232
232
|
"button",
|
|
233
233
|
{
|
|
234
|
-
|
|
234
|
+
"aria-controls": h.current,
|
|
235
|
+
"aria-label": "Next Item",
|
|
236
|
+
className: A([a["carousel-controls__btn"], a["carousel-controls__next"], "carousel-controls__next"]),
|
|
235
237
|
ref: T,
|
|
236
238
|
title: "Next Item",
|
|
237
|
-
|
|
238
|
-
"aria-controls": p.current,
|
|
239
|
-
"aria-label": "Next Item",
|
|
239
|
+
type: "button",
|
|
240
240
|
onClick: () => {
|
|
241
|
-
r.current.determineScrollAction(1);
|
|
241
|
+
r.current && r.current.determineScrollAction(1);
|
|
242
242
|
},
|
|
243
243
|
onMouseEnter: () => {
|
|
244
244
|
e.current.autoplay && r.current !== null && r.current.clearTimer();
|
|
@@ -246,27 +246,27 @@ function de({
|
|
|
246
246
|
onMouseLeave: () => {
|
|
247
247
|
e.current.autoplay && r.current !== null && r.current.startTimer();
|
|
248
248
|
},
|
|
249
|
-
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
249
|
+
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(re, { height: e.current.controlArrowSize, width: e.current.controlArrowSize }) })
|
|
250
250
|
}
|
|
251
251
|
)
|
|
252
252
|
] }),
|
|
253
|
-
e.current.showPagination &&
|
|
253
|
+
e.current.showPagination && M.length > 1 && /* @__PURE__ */ o("div", { className: [a["carousel-nav"], "carousel-nav"].join(" "), children: /* @__PURE__ */ o("ol", { className: a["carousel-nav__list"], ref: R, children: M.map((t, n) => /* @__PURE__ */ o(
|
|
254
254
|
"li",
|
|
255
255
|
{
|
|
256
|
-
className:
|
|
256
|
+
className: A([a["carousel-nav__item"], "carousel-nav__item"]),
|
|
257
257
|
"data-current": n === 0 ? "true" : "false",
|
|
258
|
+
title: `Navigate to slide ${n + 1}`,
|
|
258
259
|
onClick: () => {
|
|
259
|
-
r.current.navigateToIndex(n);
|
|
260
|
-
}
|
|
261
|
-
title: `Navigate to slide ${n + 1}`
|
|
260
|
+
r.current && r.current.navigateToIndex(n);
|
|
261
|
+
}
|
|
262
262
|
},
|
|
263
|
-
`carousel${
|
|
263
|
+
`carousel${h}-nav-${n}`
|
|
264
264
|
)) }) })
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
) });
|
|
268
268
|
}
|
|
269
269
|
export {
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
ue as Carousel,
|
|
271
|
+
ue as default
|
|
272
272
|
};
|