@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.
Files changed (126) hide show
  1. package/dist/{Form.module-DbpB9u1l.mjs → Form.module-Cd8qH2rj.mjs} +1 -1
  2. package/dist/{ResultsTable.module-nTlGw9Lh.mjs → ResultsTable.module-B7M9y7hd.mjs} +1 -5
  3. package/dist/_commonjsHelpers-C6fGbg64.mjs +6 -0
  4. package/dist/{add-FrnMPwwO.mjs → add-UWUc_nrO.mjs} +2 -2
  5. package/dist/{addMonths-BDf46gmB.mjs → addMonths-FatsTLmU.mjs} +1 -1
  6. package/dist/assets/ActionButton.css +1 -1
  7. package/dist/assets/AdBlock.css +1 -1
  8. package/dist/assets/CarouselSlide.css +1 -1
  9. package/dist/assets/ChannelSearch.css +1 -1
  10. package/dist/assets/DateNavigation.css +1 -1
  11. package/dist/assets/DatePicker.css +1 -1
  12. package/dist/assets/DeviceAndPlatformLists.css +1 -1
  13. package/dist/assets/EqualSizeFlexRow.css +1 -1
  14. package/dist/assets/EqualSizeGrid.css +1 -1
  15. package/dist/assets/FeaturedList.css +1 -1
  16. package/dist/assets/Figure.css +1 -1
  17. package/dist/assets/FindUs.css +1 -1
  18. package/dist/assets/Form.css +1 -1
  19. package/dist/assets/GridList.css +1 -1
  20. package/dist/assets/IONShowHero.css +1 -1
  21. package/dist/assets/ImageCard.css +1 -1
  22. package/dist/assets/LogoListItem.css +1 -1
  23. package/dist/assets/ModalContainer.css +1 -1
  24. package/dist/assets/PageHero.css +1 -1
  25. package/dist/assets/ProgramAirdate.css +1 -1
  26. package/dist/assets/PromotionBlock.css +1 -1
  27. package/dist/assets/ResultsTable.css +1 -1
  28. package/dist/{chevron-left-DmvQntvu.mjs → chevron-left-DRvpaLmK.mjs} +1 -1
  29. package/dist/{chevron-right-CaAz6ISN.mjs → chevron-right-C8yCnmfx.mjs} +1 -1
  30. package/dist/components/ActionButton/ActionButton.d.ts +20 -1
  31. package/dist/components/ActionButton/ActionButton.js +36 -36
  32. package/dist/components/ActionButton/index.d.ts +2 -1
  33. package/dist/components/AirDateFormatter/AirDateFormatter.js +3 -3
  34. package/dist/components/BasicGridModule/BasicGridModule.js +25 -25
  35. package/dist/components/Carousel/Carousel.d.ts +7 -24
  36. package/dist/components/Carousel/Carousel.js +109 -109
  37. package/dist/components/Carousel/CarouselUtils.class.d.ts +16 -28
  38. package/dist/components/Carousel/CarouselUtils.class.js +85 -55
  39. package/dist/components/CarouselSlide/CarouselSlide.d.ts +8 -6
  40. package/dist/components/CarouselSlide/CarouselSlide.js +90 -26
  41. package/dist/components/CarouselSlide/index.d.ts +2 -1
  42. package/dist/components/CarouselSlide/slide-layouts/Empty/Empty.d.ts +1 -1
  43. package/dist/components/CarouselSlide/slide-layouts/Empty/Empty.js +3 -4
  44. package/dist/components/CarouselSlide/slide-layouts/Empty/index.d.ts +2 -1
  45. package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.d.ts +2 -2
  46. package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.js +10 -11
  47. package/dist/components/CarouselSlide/slide-layouts/Figure/index.d.ts +2 -1
  48. package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.d.ts +2 -2
  49. package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.js +9 -10
  50. package/dist/components/CarouselSlide/slide-layouts/Text/index.d.ts +2 -1
  51. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  52. package/dist/components/CastInfoLayout/CastInfoLayout.js +1 -1
  53. package/dist/components/ChannelSearch/ChannelSearch.js +12 -12
  54. package/dist/components/Concat/Concat.js +1 -1
  55. package/dist/components/CtaBlock/CtaBlock.js +2 -2
  56. package/dist/components/CustomDataList/CustomDataList.js +44 -47
  57. package/dist/components/CustomSelect/CustomSelect.js +5 -5
  58. package/dist/components/DateNavigation/DateNavigation.js +7 -8
  59. package/dist/components/DatePicker/DatePicker.js +2527 -2452
  60. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.js +1 -1
  61. package/dist/components/DrawerNavigation/DrawerNavigation.js +27 -29
  62. package/dist/components/ErrorHandler/ErrorHandler.js +1 -1
  63. package/dist/components/FeaturedList/FeaturedList.js +7 -7
  64. package/dist/components/Figure/Figure.js +1 -1
  65. package/dist/components/FindUs/FindUs.js +6 -6
  66. package/dist/components/GenericList/GenericList.js +1 -1
  67. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.js +6 -6
  68. package/dist/components/ImageCard/ImageCard.js +6 -6
  69. package/dist/components/ImageCard/ImageCardCore.js +1 -1
  70. package/dist/components/InfoPanel/InfoPanel.js +15 -16
  71. package/dist/components/InlineNavigation/InlineNavigation.js +6 -7
  72. package/dist/components/Input/Input.js +1 -1
  73. package/dist/components/InstructionsList/InstructionsList.js +1 -1
  74. package/dist/components/Loading/Loading.js +5 -8
  75. package/dist/components/ModalContainer/ModalContainer.js +41 -44
  76. package/dist/components/Overlay/Overlay.js +17 -20
  77. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  78. package/dist/components/ProgramAirdate/ProgramAirdate.js +9 -9
  79. package/dist/components/PromotionBlock/PromotionBlock.js +15 -17
  80. package/dist/components/PromotionsRowModule/PromotionsRowModule.js +8 -8
  81. package/dist/components/ResultsTable/ResultsTable.js +7 -7
  82. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  83. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +1 -1
  84. package/dist/components/ScheduleLayout/ScheduleLayout.js +2 -2
  85. package/dist/components/ScheduleList/ScheduleList.js +17 -17
  86. package/dist/components/ScheduleList/schedule-list-items/MovieItem.js +10 -10
  87. package/dist/components/ScheduleList/schedule-list-items/SeriesItem.js +8 -8
  88. package/dist/components/ScheduleList/schedule-list-items/SportsItem.js +8 -8
  89. package/dist/components/SectionedContent/SectionedContent.js +13 -16
  90. package/dist/components/Select/Select.js +1 -1
  91. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  92. package/dist/components/ShowAboutLayout/ShowAboutLayout.js +24 -25
  93. package/dist/components/SocialLinks/SocialLinks.js +3 -3
  94. package/dist/components/SocialShareBlock/SocialShareBlock.js +8 -8
  95. package/dist/components/StringList/StringList.js +1 -1
  96. package/dist/components/TabContent/TabContent.js +1 -1
  97. package/dist/components/TextArea/TextArea.js +1 -1
  98. package/dist/components/UpcomingList/UpcomingList.js +8 -8
  99. package/dist/containers/NowPlayingContainer.js +10 -10
  100. package/dist/{facebook-osmzgL7R.mjs → facebook-HCcA1M1m.mjs} +1 -1
  101. package/dist/{format-plq8pBNY.mjs → format-YhWt2D8M.mjs} +78 -12
  102. package/dist/hooks/useGetSchedule.js +3 -3
  103. package/dist/hooks/useGetUpcoming.js +2 -2
  104. package/dist/{index-C8O1hjfH.mjs → index-0wieGV50.mjs} +0 -1
  105. package/dist/{index-DC7FmJPK.mjs → index-C-kn9Zhn.mjs} +7134 -7069
  106. package/dist/{index-CZzwT3Oj.mjs → index-DC2JJV3a.mjs} +246 -241
  107. package/dist/index-VjANCDXC.mjs +1873 -0
  108. package/dist/settings.d.ts +4 -3
  109. package/dist/{sub-CkNH5u-l.mjs → sub-CoUmnfhv.mjs} +2 -2
  110. package/dist/{subMonths-nbU1oDhB.mjs → subMonths-BtMU5A9u.mjs} +1 -1
  111. package/dist/{triangle-D0AHL9lB.mjs → triangle-PcCcGXjr.mjs} +1 -1
  112. package/dist/types.d.js +27 -0
  113. package/dist/utils/analytics.js +434 -423
  114. package/dist/utils/date-helpers.js +4 -4
  115. package/dist/utils/getFeaturedList.js +3 -3
  116. package/dist/utils/getOnNowProgram.js +3 -3
  117. package/dist/utils/getUpcomingPrograms.js +2 -2
  118. package/dist/{x-D8_C2o-U.mjs → x-C-QzJ-qD.mjs} +1 -1
  119. package/package.json +27 -24
  120. package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
  121. package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.stories.d.ts +0 -34
  122. package/dist/components/CarouselSlide/slide-layouts/Figure/Figure.stories.js +0 -105
  123. package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.stories.d.ts +0 -19
  124. package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.stories.js +0 -35
  125. package/dist/index-B0ARwqly.mjs +0 -1818
  126. /package/dist/{networks-ui.d.ts → secl-ui.d.ts} +0 -0
@@ -1,22 +1,22 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { useState as C, useEffect as H } from "react";
3
- import { subscribe as w, unsubscribe as y, publish as x } from "../../utils/events.js";
4
- import { classes as N } from "../../utils/helpers.js";
5
- import '../../assets/ActionButton.css';const S = "_scale_9huvk_1", n = {
6
- "action-btn": "_action-btn_9huvk_1",
7
- "action-btn--small": "_action-btn--small_9huvk_31",
8
- "action-btn--large": "_action-btn--large_9huvk_38",
9
- "action-btn--primary": "_action-btn--primary_9huvk_45",
10
- "action-btn--action": "_action-btn--action_9huvk_54",
11
- "action-btn--info": "_action-btn--info_9huvk_63",
12
- "action-btn--danger": "_action-btn--danger_9huvk_72",
13
- "dots-pulse": "_dots-pulse_9huvk_97",
14
- scale: S
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 A({
16
+ function $({
17
17
  label: l,
18
18
  type: c = "button",
19
- onClick: s = () => {
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: d,
31
+ disabled: s,
32
32
  classname: _ = "",
33
- ...p
33
+ ...g
34
34
  }) {
35
- const [a, b] = C("idle"), v = r === "" ? "" : `action-btn--${r}`, h = e === "" ? "" : `action-btn--${e}`, g = o.bgColor !== "" ? {
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, u = () => {
43
- b("idle");
44
- }, k = (f) => {
45
- s(f), b("waiting"), x("scripps:actionbtn:clicked");
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", u), () => {
47
+ return H(() => (w("scripps:action:completed", h), () => {
48
48
  y("scripps:action:completed");
49
- }), []), /* @__PURE__ */ i(
49
+ }), []), /* @__PURE__ */ b(
50
50
  "button",
51
51
  {
52
- type: c,
53
- className: N([
52
+ className: x([
54
53
  n["action-btn"],
55
54
  "action-btn",
56
55
  _,
57
- r === "" ? "" : n[v],
58
- e === "" ? "" : n[h]
56
+ r === "" ? "" : n[p],
57
+ e === "" ? "" : n[v]
59
58
  ]),
60
- onClick: k,
61
- disabled: a === "waiting" || d,
62
- style: g,
63
- ...p,
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__ */ i("div", { className: n["dots-pulse"], children: [
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
- A as ActionButton,
77
- A as default
76
+ $ as ActionButton,
77
+ $ as default
78
78
  };
@@ -1 +1,2 @@
1
- export { ActionButton, ActionButton as default } from './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-CkNH5u-l.mjs";
5
- import { f as m } from "../../format-plq8pBNY.mjs";
6
- import { a as u } from "../../add-FrnMPwwO.mjs";
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 P, jsx as u } from "react/jsx-runtime";
2
- import { useState as a, useRef as p, useCallback as S, useEffect as y, createElement as j } from "react";
3
- import { EqualSizeGrid as F } from "../EqualSizeGrid/EqualSizeGrid.js";
4
- import { InfoPanel as G } from "../InfoPanel/InfoPanel.js";
5
- import { classes as _ } from "../../utils/helpers.js";
6
- import { blockLayoutsMap as q } from "../../settings.js";
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: o = {
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 [r, f] = a(!1), [C, R] = a({}), [m, B] = a(null), [v, c] = a("entering"), [M, N] = a(x ? null : !0), l = p("entering"), e = p(null), i = S(() => {
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", i, { once: !0 });
33
- }), console.log("stateRef.current", l.current), console.log("infoPanelOpen", r), l.current === "exiting" ? (c("entering"), l.current = "entering", f(!0)) : c("idle");
34
- }, []), O = (t) => {
35
- t.type === "info-panel" && (R(n.resourceList.find((s) => Number.parseInt(s.id, 10) === Number.parseInt(t.resourceId, 10))), N(!1), l.current = "exiting", c("exiting"));
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
- B(q.get(o.layout));
39
- }, [o.layout]), y(() => {
40
- var t, s, h;
41
- !r && e.current !== null && ((t = e.current) != null && t.children, e.current.children.length && ((s = e.current.children[0]) == null || s.removeEventListener("animationend", i, { once: !0 }), (h = e.current.children[0]) == null || h.addEventListener("animationend", i, { once: !0 })));
42
- }, [r, i]), /* @__PURE__ */ g(P, { children: [
43
- !r && /* @__PURE__ */ g("basic-grid-module", { "data-state": v, "first-entry": M, ref: e, children: [
44
- d !== "" && /* @__PURE__ */ u("h2", { className: _(["basic-grid-module__header", "h4"]), children: d }),
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
- F,
46
+ _,
47
47
  {
48
48
  gap: b,
49
49
  itemsPerRow: k,
50
50
  classname: L,
51
51
  children: E.map(
52
- (t) => /* @__PURE__ */ j(
52
+ (t) => /* @__PURE__ */ G(
53
53
  m,
54
54
  {
55
55
  ...t,
56
- ...o.props,
56
+ ...s.props,
57
57
  relatedResourceId: t.id,
58
- handleClicks: I ?? O,
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
- r && n.layout && /* @__PURE__ */ u(
67
- G,
66
+ a && n.layout && /* @__PURE__ */ u(
67
+ q,
68
68
  {
69
69
  className: "grid-info-panel",
70
70
  onBackClicked: () => {
@@ -1,25 +1,8 @@
1
- export function Carousel({ id, slides, options }: {
2
- id: any;
3
- slides: any;
4
- options?: {
5
- paginationType: string;
6
- showControls: boolean;
7
- controlArrowSize: number;
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 X, jsxs as K } from "react/jsx-runtime";
2
- import { useRef as s, useState as P, useEffect as B, useCallback as d } from "react";
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 re } from "../../chevron-left-DmvQntvu.mjs";
8
- import { C as te } from "../../chevron-right-CaAz6ISN.mjs";
9
- const b = window.matchMedia("(width <= 600px)"), z = window.matchMedia("(width <= 800px"), E = window.matchMedia("(width <= 1024px"), L = window.matchMedia("(width <= 1280px");
10
- function de({
11
- id: g,
12
- slides: x,
13
- options: I = {
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
- console.log(`Carousel component with id: ${g} initialized`);
35
- const p = s(`carousel-${g}`), R = s(null), i = s(null), $ = s(null), m = s(x), T = s(null), S = s(null), r = s(null), e = s(I), l = s(I), N = s("-50%"), [M, G] = P([]), [k, H] = P([]), [D, U] = P(0);
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
- b.matches ? e.current = {
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
- } : z.matches ? l.current.cellsPerSlide !== 1 ? e.current = {
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
- } : E.matches ? l.current.cellsPerSlide !== 1 && l.current.cellsPerSlide !== 2 ? e.current = {
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
- } : L.matches ? l.current.showPagination ? e.current = {
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
- U((u) => u + 1), t();
73
+ H((u) => u + 1), t();
75
74
  };
76
- return b.addEventListener("change", n), z.addEventListener("change", n), E.addEventListener("change", n), L.addEventListener("change", n), () => {
77
- b.removeEventListener("change", n), z.removeEventListener("change", n), E.removeEventListener("change", n), L.removeEventListener("change", n);
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 O = d((t, n) => {
81
- const u = ee(n, t);
82
- H([...u]);
83
- let h = [];
84
- for (let c = 0; c <= u.length - 1; c++) {
85
- h[c] = {}, h[c].ariaLabel = `${c + 1} of ${u.length}`, h[c].layout = u[c][0].layout, h[c].cells = [];
86
- for (let w = 0; w <= u[c].length - 1; w++)
87
- h[c].cells[w] = {
88
- props: u[c][w].props
89
- };
90
- }
91
- const C = [...h], A = [...h], J = C.slice(-1), Q = C.slice(0);
92
- return A.push(Q[0]), A.unshift(J[0]), e.current.wrapAround && t.length > n ? A : C;
93
- }, []), f = d(() => {
94
- e.current.autoplay && r.current.clearTimer();
95
- }, []), F = d((t) => {
96
- f();
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
- }, [f]), W = d(() => {
100
- f(), i.current.addEventListener("scrollend", () => {
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
- }, [f]), v = d(() => {
104
- f(), i.current.addEventListener("scrollend", () => {
105
- r.current.handleScrollEnd(), i.current.addEventListener("scroll", v, { once: !0 });
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
- }, [f]), q = () => {
107
+ }, [d]), W = () => {
108
108
  r.current && e.current.autoplay && r.current.clearTimer();
109
- }, y = d(() => {
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 && D > 0 && ((n = (t = r.current).clearTimer) == null || n.call(t), r.current = null), r.current = new Y({
114
- carouselEl: R.current,
115
- scrollerEl: i.current,
116
- paginationEl: $.current,
117
- slides: m.current,
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: S.current
120
+ previous: m.current
121
121
  },
122
- id: p.current,
122
+ id: h.current,
123
123
  options: {
124
124
  autoplay: e.current.autoplay,
125
- wrapAround: e.current.wrapAround && m.current.length > e.current.cellsPerSlide,
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 && m.current.length > e.current.cellsPerSlide,
130
+ showControls: e.current.showControls && p.current.length > (e.current.cellsPerSlide || 1),
131
131
  cellsPerSlide: e.current.cellsPerSlide
132
132
  }
133
133
  });
134
- }, [D]), V = d(() => {
135
- i.current.addEventListener("scroll", v, { once: !0 });
136
- }, [v]), j = d(() => {
137
- if (G(O(m.current, e.current.cellsPerSlide)), m.current.length > e.current.cellsPerSlide) {
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
- i.current !== null && (S.current !== null && e.current.showControls || !e.current.showControls) && (clearInterval(t), V(), y());
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
- i.current !== null && (clearInterval(t), y());
143
+ c.current !== null && (clearInterval(t), g());
144
144
  }, 100);
145
145
  }
146
- }, [O, V, y]);
147
- return B(() => {
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), N.current = `calc(-50% - ${t}px)`;
151
+ e.current.showPagination && (t = t + 25), e.current.showScrollbar && (t = t + 6), $.current = `calc(-50% - ${t}px)`;
152
152
  }
153
- j();
153
+ V();
154
154
  }
155
155
  return () => {
156
- q();
156
+ W();
157
157
  };
158
- }, [j, e]), /* @__PURE__ */ o(X, { children: e.current !== null && /* @__PURE__ */ K(
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: p.current,
163
- ref: R,
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": N.current
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
- ref: i,
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: W,
196
- "data-scrollbar": e.current.showScrollbar,
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${g}-slide${n}`
205
+ `carousel${E}-slide${n}`
206
206
  ))
207
207
  }
208
208
  ),
209
- e.current.showControls && x.length > e.current.cellsPerSlide && /* @__PURE__ */ K("div", { className: a["carousel-controls"], children: [
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
- type: "button",
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(re, { width: e.current.controlArrowSize, height: e.current.controlArrowSize }) })
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
- type: "button",
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
- className: _([a["carousel-controls__btn"], a["carousel-controls__next"], "carousel-controls__next"]),
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(te, { width: e.current.controlArrowSize, height: e.current.controlArrowSize }) })
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 && k.length > 1 && /* @__PURE__ */ o("div", { className: [a["carousel-nav"], "carousel-nav"].join(" "), children: /* @__PURE__ */ o("ol", { className: a["carousel-nav__list"], ref: $, children: k.map((t, n) => /* @__PURE__ */ o(
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: _([a["carousel-nav__item"], "carousel-nav__item"]),
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${p}-nav-${n}`
263
+ `carousel${h}-nav-${n}`
264
264
  )) }) })
265
265
  ]
266
266
  }
267
267
  ) });
268
268
  }
269
269
  export {
270
- de as Carousel,
271
- de as default
270
+ ue as Carousel,
271
+ ue as default
272
272
  };