@scrippsproduct/networks-ui-library 1.1.9 → 1.1.10-alpha.0

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 (120) hide show
  1. package/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
  2. package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
  4. package/dist/assets/ResultsTable.css +1 -1
  5. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  6. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  7. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  8. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  9. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  10. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  11. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  12. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  13. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  14. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  15. package/dist/components/Button/Button.test.js +434 -0
  16. package/dist/components/Carousel/Carousel.js +2 -2
  17. package/dist/components/Carousel/Carousel.test.js +705 -0
  18. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  19. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  20. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  21. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  22. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  23. package/dist/components/Concat/Concat.js +1 -1
  24. package/dist/components/Concat/Concat.test.js +115 -0
  25. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  26. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  27. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  28. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  29. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  30. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  31. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  32. package/dist/components/DatePicker/DatePicker.js +1 -1
  33. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  34. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  35. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  36. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  37. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  38. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  39. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  40. package/dist/components/Figure/Figure.js +1 -1
  41. package/dist/components/Figure/Figure.test.js +198 -0
  42. package/dist/components/FindUs/FindUs.test.js +499 -0
  43. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  44. package/dist/components/GenericList/GenericList.js +1 -1
  45. package/dist/components/GenericList/GenericList.test.js +288 -0
  46. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  47. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  48. package/dist/components/GradientButton/GradientButton.js +33 -31
  49. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  50. package/dist/components/GridList/GridList.test.js +371 -0
  51. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  52. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  53. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  54. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  55. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  56. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  57. package/dist/components/Input/Input.js +1 -1
  58. package/dist/components/Input/Input.test.js +263 -0
  59. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  60. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  61. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  62. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  63. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  64. package/dist/components/NavList/NavList.test.js +332 -0
  65. package/dist/components/Overlay/Overlay.js +24 -23
  66. package/dist/components/Overlay/Overlay.test.js +198 -0
  67. package/dist/components/PageHero/PageHero.test.js +241 -0
  68. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  69. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  71. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  72. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  73. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  74. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  75. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  76. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  77. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  78. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  79. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  80. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  82. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  83. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  84. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  85. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  86. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  88. package/dist/components/Select/Select.js +24 -24
  89. package/dist/components/Select/Select.test.js +367 -0
  90. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  91. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  92. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  93. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  94. package/dist/components/StringList/StringList.js +1 -1
  95. package/dist/components/StringList/StringList.test.js +311 -0
  96. package/dist/components/TabContent/TabContent.js +1 -1
  97. package/dist/components/TabContent/TabContent.test.js +274 -0
  98. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  99. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  100. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  101. package/dist/components/TextArea/TextArea.js +1 -1
  102. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  103. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  104. package/dist/index-BUN4jQ3m.mjs +3098 -0
  105. package/dist/index-BVxBrkZB.mjs +3 -0
  106. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  107. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  108. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  109. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  110. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  111. package/dist/test/setupTests.d.ts +1 -0
  112. package/dist/test/setupTests.js +55 -0
  113. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  114. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  115. package/dist/utils/analytics.js +1 -1
  116. package/dist/utils/getOnNowProgram.js +10 -10
  117. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  118. package/package.json +4 -1
  119. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  120. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -1,51 +1,51 @@
1
- import { jsxs as B, jsx as n } from "react/jsx-runtime";
2
- import { useState as N, useEffect as T } from "react";
3
- import { GradientButton as y } from "../GradientButton/GradientButton.js";
4
- import { Button as k } from "../Button/Button.js";
1
+ import { jsxs as x, jsx as n } from "react/jsx-runtime";
2
+ import { useState as B, useEffect as N } from "react";
3
+ import { GradientButton as T } from "../GradientButton/GradientButton.js";
4
+ import { Button as y } from "../Button/Button.js";
5
5
  import '../../assets/TabNavigation.css';const r = {
6
6
  "tab-navigation__list": "_tab-navigation__list_146qs_6",
7
7
  "tab-navigation__right-side": "_tab-navigation__right-side_146qs_16"
8
8
  };
9
- function w({
9
+ function $({
10
10
  tabs: i = [],
11
11
  onTabChanged: l = () => !0,
12
12
  rightSideContent: a
13
13
  }) {
14
- const [e, j] = N(i[0]), u = (t) => {
14
+ const [e, j] = B(i[0]), u = (t) => {
15
15
  const o = document.querySelector("basic-grid-module");
16
16
  o == null || o.setAttribute("first-entry", "true"), o == null || o.setAttribute("data-state", "entering"), !(!t.button || !e.button) && t.button.label !== e.button.label && j(t);
17
17
  };
18
- return T(() => {
18
+ return N(() => {
19
19
  l(e);
20
- }, [e, l]), /* @__PURE__ */ B("tab-navigation", { children: [
21
- /* @__PURE__ */ n("ul", { className: [r["tab-navigation__list"], "tab-navigation__list"].join(" "), children: i.length > 0 && i.map((t) => {
22
- var o, b, s, _, g, c, d, m, v, C, f, h, p, x, H;
23
- return ((o = e.button) == null ? void 0 : o.label) === ((b = t.button) == null ? void 0 : b.label) ? /* @__PURE__ */ n(
20
+ }, [e, l]), /* @__PURE__ */ x("tab-navigation", { children: [
21
+ /* @__PURE__ */ n("ul", { className: [r["tab-navigation__list"], "tab-navigation__list"].join(" "), children: i.length > 0 && i.map((t, o) => {
22
+ var b, s, _, g, c, d, m, v, C, f, h, p, H;
23
+ return ((b = e.button) == null ? void 0 : b.label) === ((s = t.button) == null ? void 0 : s.label) ? /* @__PURE__ */ n(
24
24
  "li",
25
25
  {
26
26
  className: [r["tab-navigation__item"], "tab-navigation__item"].join(" "),
27
27
  style: {
28
- "--gradient-start-color": (s = t.button) == null ? void 0 : s.gradientStartColor,
29
- "--gradient-end-color": (_ = t.button) == null ? void 0 : _.gradientEndColor
28
+ "--gradient-start-color": (_ = t.button) == null ? void 0 : _.gradientStartColor,
29
+ "--gradient-end-color": (g = t.button) == null ? void 0 : g.gradientEndColor
30
30
  },
31
31
  children: /* @__PURE__ */ n(
32
- y,
32
+ T,
33
33
  {
34
34
  disabled: !0,
35
- label: (g = t.button) == null ? void 0 : g.label,
35
+ label: (c = t.button) == null ? void 0 : c.label,
36
36
  onClick: () => {
37
37
  u(t);
38
38
  }
39
39
  }
40
40
  )
41
41
  },
42
- `tab-item-${(c = t.button) == null ? void 0 : c.label}`
42
+ `tab-item-${o}`
43
43
  ) : /* @__PURE__ */ n(
44
44
  "li",
45
45
  {
46
46
  className: [r["tab-navigation__item"], "tab-navigation__item"].join(" "),
47
47
  children: /* @__PURE__ */ n(
48
- k,
48
+ y,
49
49
  {
50
50
  customColors: {
51
51
  bgColor: (d = t.button) == null ? void 0 : d.buttonBgColor,
@@ -55,20 +55,20 @@ function w({
55
55
  borderColor: (f = t.button) == null ? void 0 : f.buttonTextColor,
56
56
  borderHoverColor: ((h = t.button) == null ? void 0 : h.borderHoverColor) ?? ((p = t.button) == null ? void 0 : p.buttonHoverBgColor)
57
57
  },
58
- label: (x = t.button) == null ? void 0 : x.label,
58
+ label: (H = t.button) == null ? void 0 : H.label,
59
59
  onClick: () => {
60
60
  u(t);
61
61
  }
62
62
  }
63
63
  )
64
64
  },
65
- `tab-item-${(H = t.button) == null ? void 0 : H.label}`
65
+ `tab-item-${o}`
66
66
  );
67
67
  }) }),
68
68
  /* @__PURE__ */ n("div", { className: r["tab-navigation__right-side"], children: a !== void 0 && a })
69
69
  ] });
70
70
  }
71
71
  export {
72
- w as TabNavigation,
73
- w as default
72
+ $ as TabNavigation,
73
+ $ as default
74
74
  };
@@ -0,0 +1,535 @@
1
+ import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
+ import { v as C, d as h, b as y, i as l, r, g as o, s as i, f as u } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { TabNavigation as b } from "./TabNavigation.js";
4
+ C.mock("../GradientButton", () => ({
5
+ default: ({ label: t, onClick: s, disabled: c }) => /* @__PURE__ */ f(
6
+ "button",
7
+ {
8
+ "data-disabled": c,
9
+ "data-label": t,
10
+ "data-testid": "gradient-button",
11
+ onClick: s,
12
+ children: [
13
+ "GradientButton: ",
14
+ t
15
+ ]
16
+ }
17
+ )
18
+ }));
19
+ C.mock("../Button", () => ({
20
+ default: ({ label: t, onClick: s, customColors: c }) => /* @__PURE__ */ f(
21
+ "button",
22
+ {
23
+ "data-bg-color": c == null ? void 0 : c.bgColor,
24
+ "data-bg-hover-color": c == null ? void 0 : c.bgHoverColor,
25
+ "data-border-color": c == null ? void 0 : c.borderColor,
26
+ "data-border-hover-color": c == null ? void 0 : c.borderHoverColor,
27
+ "data-color": c == null ? void 0 : c.color,
28
+ "data-hover-color": c == null ? void 0 : c.hoverColor,
29
+ "data-label": t,
30
+ "data-testid": "button",
31
+ onClick: s,
32
+ children: [
33
+ "Button: ",
34
+ t
35
+ ]
36
+ }
37
+ )
38
+ }));
39
+ C.mock("./TabNavigation.module.scss", () => ({
40
+ default: {
41
+ "tab-navigation__list": "tab-navigation__list",
42
+ "tab-navigation__item": "tab-navigation__item",
43
+ "tab-navigation__right-side": "tab-navigation__right-side"
44
+ }
45
+ }));
46
+ h("TabNavigation Component", () => {
47
+ const t = (e) => ({
48
+ title: "Test Tab",
49
+ content: /* @__PURE__ */ a("div", { children: "Test Content" }),
50
+ button: {
51
+ label: "Test Button",
52
+ gradientStartColor: "#ff0000",
53
+ gradientEndColor: "#00ff00",
54
+ buttonBgColor: "#ffffff",
55
+ buttonHoverBgColor: "#eeeeee",
56
+ buttonTextColor: "#000000",
57
+ buttonHoverTextColor: "#333333"
58
+ },
59
+ ...e
60
+ });
61
+ let s, c, T;
62
+ y(() => {
63
+ s = C.fn(), T = C.fn(), c = C.fn(), global.document.querySelector = c, c.mockReturnValue({
64
+ setAttribute: T
65
+ });
66
+ }), h("Basic Rendering", () => {
67
+ l("renders tab-navigation custom element", () => {
68
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e }));
69
+ o(n.querySelector("tab-navigation")).toBeInTheDocument();
70
+ }), l("renders ul with correct classes", () => {
71
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelector("ul");
72
+ o(d).toHaveClass("tab-navigation__list");
73
+ }), l("renders li items for each tab", () => {
74
+ const e = [
75
+ t({ button: { ...t().button, label: "Tab 1" } }),
76
+ t({ button: { ...t().button, label: "Tab 2" } }),
77
+ t({ button: { ...t().button, label: "Tab 3" } })
78
+ ], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelectorAll(".tab-navigation__item");
79
+ o(d.length).toBe(3);
80
+ }), l("renders right-side content div", () => {
81
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelector(".tab-navigation__right-side");
82
+ o(d).toBeInTheDocument();
83
+ }), l("renders nothing when tabs array is empty", () => {
84
+ const { container: e } = r(/* @__PURE__ */ a(b, { tabs: [] })), n = e.querySelectorAll(".tab-navigation__item");
85
+ o(n.length).toBe(0);
86
+ });
87
+ }), h("Initial State", () => {
88
+ l("sets first tab as current tab initially", () => {
89
+ const e = [
90
+ t({ button: { ...t().button, label: "First" } }),
91
+ t({ button: { ...t().button, label: "Second" } })
92
+ ];
93
+ r(/* @__PURE__ */ a(b, { tabs: e }));
94
+ const n = i.getByTestId("gradient-button");
95
+ o(n).toHaveAttribute("data-label", "First");
96
+ }), l("renders first tab as disabled GradientButton", () => {
97
+ const e = [t({ button: { ...t().button, label: "Tab 1" } })];
98
+ r(/* @__PURE__ */ a(b, { tabs: e }));
99
+ const n = i.getByTestId("gradient-button");
100
+ o(n).toHaveAttribute("data-disabled", "true");
101
+ }), l("renders non-current tabs as regular Button", () => {
102
+ const e = [
103
+ t({ button: { ...t().button, label: "First" } }),
104
+ t({ button: { ...t().button, label: "Second" } })
105
+ ];
106
+ r(/* @__PURE__ */ a(b, { tabs: e }));
107
+ const n = i.getAllByTestId("button");
108
+ o(n.length).toBe(1), o(n[0]).toHaveAttribute("data-label", "Second");
109
+ }), l("calls onTabChanged with first tab on mount", () => {
110
+ const e = [t({ button: { ...t().button, label: "First" } })];
111
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(s).toHaveBeenCalledWith(e[0]);
112
+ });
113
+ }), h("Tab Switching", () => {
114
+ l("switches to new tab when different tab button clicked", () => {
115
+ const e = [
116
+ t({ button: { ...t().button, label: "First" } }),
117
+ t({ button: { ...t().button, label: "Second" } })
118
+ ], { rerender: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = i.getByTestId("button");
119
+ u.click(d), n(/* @__PURE__ */ a(b, { tabs: e }));
120
+ const g = i.getByTestId("gradient-button");
121
+ o(g).toHaveAttribute("data-label", "Second");
122
+ }), l("does not switch when clicking current tab", () => {
123
+ const e = [
124
+ t({ button: { ...t().button, label: "First" } }),
125
+ t({ button: { ...t().button, label: "Second" } })
126
+ ];
127
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear();
128
+ const n = i.getByTestId("gradient-button");
129
+ u.click(n), o(s).not.toHaveBeenCalled();
130
+ }), l("calls onTabChanged when tab switches", () => {
131
+ const e = [
132
+ t({ button: { ...t().button, label: "First" } }),
133
+ t({ button: { ...t().button, label: "Second" } })
134
+ ];
135
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear();
136
+ const n = i.getByTestId("button");
137
+ u.click(n), o(s).toHaveBeenCalledWith(e[1]);
138
+ }), l("switches between multiple tabs correctly", () => {
139
+ const e = [
140
+ t({ button: { ...t().button, label: "Tab 1" } }),
141
+ t({ button: { ...t().button, label: "Tab 2" } }),
142
+ t({ button: { ...t().button, label: "Tab 3" } })
143
+ ], { rerender: n } = r(/* @__PURE__ */ a(b, { tabs: e }));
144
+ let d = i.getAllByTestId("button");
145
+ u.click(d[0]), n(/* @__PURE__ */ a(b, { tabs: e }));
146
+ let g = i.getByTestId("gradient-button");
147
+ o(g).toHaveAttribute("data-label", "Tab 2"), d = i.getAllByTestId("button");
148
+ const B = d.find((v) => v.getAttribute("data-label") === "Tab 3");
149
+ u.click(B), n(/* @__PURE__ */ a(b, { tabs: e })), g = i.getByTestId("gradient-button"), o(g).toHaveAttribute("data-label", "Tab 3");
150
+ });
151
+ }), h("DOM Manipulation - basic-grid-module", () => {
152
+ l("queries for basic-grid-module element on tab click", () => {
153
+ const e = [
154
+ t({ button: { ...t().button, label: "First" } }),
155
+ t({ button: { ...t().button, label: "Second" } })
156
+ ];
157
+ r(/* @__PURE__ */ a(b, { tabs: e })), c.mockClear();
158
+ const n = i.getByTestId("button");
159
+ u.click(n), o(c).toHaveBeenCalledWith("basic-grid-module");
160
+ }), l("sets first-entry attribute to true on tab switch", () => {
161
+ const e = [
162
+ t({ button: { ...t().button, label: "First" } }),
163
+ t({ button: { ...t().button, label: "Second" } })
164
+ ];
165
+ r(/* @__PURE__ */ a(b, { tabs: e })), T.mockClear();
166
+ const n = i.getByTestId("button");
167
+ u.click(n), o(T).toHaveBeenCalledWith("first-entry", "true");
168
+ }), l("sets data-state attribute to entering on tab switch", () => {
169
+ const e = [
170
+ t({ button: { ...t().button, label: "First" } }),
171
+ t({ button: { ...t().button, label: "Second" } })
172
+ ];
173
+ r(/* @__PURE__ */ a(b, { tabs: e })), T.mockClear();
174
+ const n = i.getByTestId("button");
175
+ u.click(n), o(T).toHaveBeenCalledWith("data-state", "entering");
176
+ }), l("handles missing basic-grid-module element gracefully", () => {
177
+ const e = [
178
+ t({ button: { ...t().button, label: "First" } }),
179
+ t({ button: { ...t().button, label: "Second" } })
180
+ ];
181
+ c.mockReturnValue(null), r(/* @__PURE__ */ a(b, { tabs: e }));
182
+ const n = i.getByTestId("button");
183
+ o(() => u.click(n)).not.toThrow();
184
+ }), l("sets both attributes in correct order", () => {
185
+ const e = [
186
+ t({ button: { ...t().button, label: "First" } }),
187
+ t({ button: { ...t().button, label: "Second" } })
188
+ ];
189
+ r(/* @__PURE__ */ a(b, { tabs: e })), T.mockClear();
190
+ const n = i.getByTestId("button");
191
+ u.click(n), o(T).toHaveBeenNthCalledWith(1, "first-entry", "true"), o(T).toHaveBeenNthCalledWith(2, "data-state", "entering");
192
+ });
193
+ }), h("Current Tab Rendering", () => {
194
+ l("renders current tab with GradientButton component", () => {
195
+ const e = [t({ button: { ...t().button, label: "Current" } })];
196
+ r(/* @__PURE__ */ a(b, { tabs: e })), o(i.getByTestId("gradient-button")).toBeInTheDocument(), o(i.queryByTestId("button")).not.toBeInTheDocument();
197
+ }), l("passes label to GradientButton", () => {
198
+ const e = [t({ button: { ...t().button, label: "My Tab" } })];
199
+ r(/* @__PURE__ */ a(b, { tabs: e }));
200
+ const n = i.getByTestId("gradient-button");
201
+ o(n).toHaveAttribute("data-label", "My Tab");
202
+ }), l("sets GradientButton as disabled", () => {
203
+ const e = [t({ button: { ...t().button, label: "Tab" } })];
204
+ r(/* @__PURE__ */ a(b, { tabs: e }));
205
+ const n = i.getByTestId("gradient-button");
206
+ o(n).toHaveAttribute("data-disabled", "true");
207
+ }), l("applies CSS custom properties for gradient colors", () => {
208
+ const e = [t({
209
+ button: {
210
+ label: "Tab",
211
+ gradientStartColor: "#ff0000",
212
+ gradientEndColor: "#00ff00",
213
+ buttonBgColor: "#ffffff",
214
+ buttonHoverBgColor: "#eeeeee",
215
+ buttonTextColor: "#000000",
216
+ buttonHoverTextColor: "#333333"
217
+ }
218
+ })], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelector(".tab-navigation__item");
219
+ o(d).toHaveStyle({
220
+ "--gradient-start-color": "#ff0000",
221
+ "--gradient-end-color": "#00ff00"
222
+ });
223
+ }), l("generates correct key for current tab list item", () => {
224
+ const e = [t({ button: { ...t().button, label: "My Tab" } })], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelector('li[class*="tab-navigation__item"]');
225
+ o(d).toBeInTheDocument();
226
+ });
227
+ }), h("Non-Current Tab Rendering", () => {
228
+ l("renders non-current tabs with Button component", () => {
229
+ const e = [
230
+ t({ button: { ...t().button, label: "First" } }),
231
+ t({ button: { ...t().button, label: "Second" } })
232
+ ];
233
+ r(/* @__PURE__ */ a(b, { tabs: e })), o(i.getByTestId("button")).toBeInTheDocument();
234
+ }), l("passes label to Button", () => {
235
+ const e = [
236
+ t({ button: { ...t().button, label: "First" } }),
237
+ t({ button: { ...t().button, label: "Second" } })
238
+ ];
239
+ r(/* @__PURE__ */ a(b, { tabs: e }));
240
+ const n = i.getByTestId("button");
241
+ o(n).toHaveAttribute("data-label", "Second");
242
+ }), l("passes customColors to Button", () => {
243
+ const e = [
244
+ t({ button: { ...t().button, label: "First" } }),
245
+ t({
246
+ button: {
247
+ label: "Second",
248
+ gradientStartColor: "#aaaaaa",
249
+ gradientEndColor: "#bbbbbb",
250
+ buttonBgColor: "#cccccc",
251
+ buttonHoverBgColor: "#dddddd",
252
+ buttonTextColor: "#eeeeee",
253
+ buttonHoverTextColor: "#ffffff"
254
+ }
255
+ })
256
+ ];
257
+ r(/* @__PURE__ */ a(b, { tabs: e }));
258
+ const n = i.getByTestId("button");
259
+ o(n).toHaveAttribute("data-bg-color", "#cccccc"), o(n).toHaveAttribute("data-bg-hover-color", "#dddddd"), o(n).toHaveAttribute("data-color", "#eeeeee"), o(n).toHaveAttribute("data-hover-color", "#ffffff"), o(n).toHaveAttribute("data-border-color", "#eeeeee");
260
+ }), l("uses borderHoverColor when provided", () => {
261
+ const e = [
262
+ t({ button: { ...t().button, label: "First" } }),
263
+ t({
264
+ button: {
265
+ label: "Second",
266
+ gradientStartColor: "#aaaaaa",
267
+ gradientEndColor: "#bbbbbb",
268
+ buttonBgColor: "#cccccc",
269
+ buttonHoverBgColor: "#dddddd",
270
+ buttonTextColor: "#eeeeee",
271
+ buttonHoverTextColor: "#ffffff",
272
+ borderHoverColor: "#123456"
273
+ }
274
+ })
275
+ ];
276
+ r(/* @__PURE__ */ a(b, { tabs: e }));
277
+ const n = i.getByTestId("button");
278
+ o(n).toHaveAttribute("data-border-hover-color", "#123456");
279
+ }), l("falls back to buttonHoverBgColor for borderHoverColor when not provided", () => {
280
+ const e = [
281
+ t({ button: { ...t().button, label: "First" } }),
282
+ t({
283
+ button: {
284
+ label: "Second",
285
+ gradientStartColor: "#aaaaaa",
286
+ gradientEndColor: "#bbbbbb",
287
+ buttonBgColor: "#cccccc",
288
+ buttonHoverBgColor: "#dddddd",
289
+ buttonTextColor: "#eeeeee",
290
+ buttonHoverTextColor: "#ffffff"
291
+ }
292
+ })
293
+ ];
294
+ r(/* @__PURE__ */ a(b, { tabs: e }));
295
+ const n = i.getByTestId("button");
296
+ o(n).toHaveAttribute("data-border-hover-color", "#dddddd");
297
+ }), l("does not apply CSS custom properties to non-current tabs", () => {
298
+ const e = [
299
+ t({ button: { ...t().button, label: "First" } }),
300
+ t({ button: { ...t().button, label: "Second" } })
301
+ ], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), g = n.querySelectorAll(".tab-navigation__item")[1];
302
+ o(g).not.toHaveStyle({
303
+ "--gradient-start-color": o.anything()
304
+ });
305
+ }), l("generates correct key for non-current tab list items", () => {
306
+ const e = [
307
+ t({ button: { ...t().button, label: "First" } }),
308
+ t({ button: { ...t().button, label: "Second" } })
309
+ ], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelectorAll('li[class*="tab-navigation__item"]');
310
+ o(d.length).toBe(2);
311
+ });
312
+ }), h("Right Side Content", () => {
313
+ l("renders rightSideContent when provided", () => {
314
+ const e = [t()];
315
+ r(/* @__PURE__ */ a(b, { rightSideContent: /* @__PURE__ */ a("div", { "data-testid": "right-content", children: "Right Side" }), tabs: e })), o(i.getByTestId("right-content")).toBeInTheDocument();
316
+ }), l("does not render content when rightSideContent is undefined", () => {
317
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelector(".tab-navigation__right-side");
318
+ o(d == null ? void 0 : d.textContent).toBe("");
319
+ }), l("renders complex JSX as rightSideContent", () => {
320
+ const e = [t()];
321
+ r(/* @__PURE__ */ a(b, { rightSideContent: /* @__PURE__ */ f("div", { "data-testid": "complex-content", children: [
322
+ /* @__PURE__ */ a("span", { children: "Nested" }),
323
+ /* @__PURE__ */ a("button", { children: "Click" })
324
+ ] }), tabs: e })), o(i.getByTestId("complex-content")).toBeInTheDocument(), o(i.getByText("Nested")).toBeInTheDocument(), o(i.getByText("Click")).toBeInTheDocument();
325
+ }), l("renders string as rightSideContent", () => {
326
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { rightSideContent: "Text Content", tabs: e })), d = n.querySelector(".tab-navigation__right-side");
327
+ o(d == null ? void 0 : d.textContent).toBe("Text Content");
328
+ }), l("renders number as rightSideContent", () => {
329
+ const e = [t()], { container: n } = r(/* @__PURE__ */ a(b, { rightSideContent: 42, tabs: e })), d = n.querySelector(".tab-navigation__right-side");
330
+ o(d == null ? void 0 : d.textContent).toBe("42");
331
+ });
332
+ }), h("HandleClick Edge Cases", () => {
333
+ l("does not change tab when button is undefined", () => {
334
+ const e = [
335
+ t({ button: void 0 }),
336
+ t({ button: void 0 })
337
+ ];
338
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear(), o(s).not.toHaveBeenCalled();
339
+ }), l("compares button labels correctly", () => {
340
+ const e = [
341
+ t({ button: { ...t().button, label: "Tab A" } }),
342
+ t({ button: { ...t().button, label: "Tab B" } })
343
+ ], { rerender: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = i.getByTestId("button");
344
+ u.click(d), n(/* @__PURE__ */ a(b, { tabs: e }));
345
+ const g = i.getByTestId("gradient-button");
346
+ o(g).toHaveAttribute("data-label", "Tab B");
347
+ }), l("does not change when labels are identical", () => {
348
+ const e = [
349
+ t({ button: { ...t().button, label: "Same" } }),
350
+ t({ button: { ...t().button, label: "Same" } })
351
+ ];
352
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear();
353
+ const n = i.getAllByTestId("gradient-button");
354
+ o(n.length).toBe(2), u.click(n[0]), o(s).not.toHaveBeenCalled();
355
+ });
356
+ }), h("onTabChanged Callback", () => {
357
+ l("uses default no-op function when onTabChanged not provided", () => {
358
+ const e = [t()];
359
+ o(() => r(/* @__PURE__ */ a(b, { tabs: e }))).not.toThrow();
360
+ }), l("calls onTabChanged on initial render", () => {
361
+ const e = [t()];
362
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(s).toHaveBeenCalledTimes(1), o(s).toHaveBeenCalledWith(e[0]);
363
+ }), l("calls onTabChanged when currentTab changes", () => {
364
+ const e = [
365
+ t({ button: { ...t().button, label: "First" } }),
366
+ t({ button: { ...t().button, label: "Second" } })
367
+ ];
368
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear();
369
+ const n = i.getByTestId("button");
370
+ u.click(n), o(s).toHaveBeenCalledWith(e[1]);
371
+ }), l("does not call onTabChanged when clicking current tab", () => {
372
+ const e = [t({ button: { ...t().button, label: "Tab" } })];
373
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), s.mockClear();
374
+ const n = i.getByTestId("gradient-button");
375
+ u.click(n), o(s).not.toHaveBeenCalled();
376
+ }), l("calls onTabChanged multiple times during tab navigation", () => {
377
+ const e = [
378
+ t({ button: { ...t().button, label: "Tab 1" } }),
379
+ t({ button: { ...t().button, label: "Tab 2" } }),
380
+ t({ button: { ...t().button, label: "Tab 3" } })
381
+ ], { rerender: n } = r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s }));
382
+ o(s).toHaveBeenCalledWith(e[0]), s.mockClear();
383
+ let d = i.getAllByTestId("button");
384
+ u.click(d[0]), n(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(s).toHaveBeenCalledWith(e[1]), s.mockClear(), d = i.getAllByTestId("button");
385
+ const g = d.find((B) => B.getAttribute("data-label") === "Tab 3");
386
+ u.click(g), n(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(s).toHaveBeenCalledWith(e[2]);
387
+ });
388
+ }), h("Edge Cases", () => {
389
+ l("handles empty tabs array", () => {
390
+ const { container: e } = r(/* @__PURE__ */ a(b, { tabs: [] })), n = e.querySelectorAll(".tab-navigation__item");
391
+ o(n.length).toBe(0);
392
+ }), l("handles single tab", () => {
393
+ const e = [t({ button: { ...t().button, label: "Only" } })];
394
+ r(/* @__PURE__ */ a(b, { tabs: e })), o(i.getByTestId("gradient-button")).toBeInTheDocument(), o(i.queryByTestId("button")).not.toBeInTheDocument();
395
+ }), l("handles many tabs", () => {
396
+ const e = Array.from(
397
+ { length: 10 },
398
+ (g, B) => t({ button: { ...t().button, label: `Tab ${B + 1}` } })
399
+ ), { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelectorAll(".tab-navigation__item");
400
+ o(d.length).toBe(10);
401
+ }), l("handles tabs with special characters in labels", () => {
402
+ const e = [
403
+ t({ button: { ...t().button, label: "Tab & More" } }),
404
+ t({ button: { ...t().button, label: "Tab <1>" } })
405
+ ];
406
+ r(/* @__PURE__ */ a(b, { tabs: e }));
407
+ const n = i.getByTestId("gradient-button");
408
+ o(n).toHaveAttribute("data-label", "Tab & More");
409
+ }), l("handles tabs with very long labels", () => {
410
+ const e = "A".repeat(100), n = [t({ button: { ...t().button, label: e } })];
411
+ r(/* @__PURE__ */ a(b, { tabs: n }));
412
+ const d = i.getByTestId("gradient-button");
413
+ o(d).toHaveAttribute("data-label", e);
414
+ }), l("handles tabs without button property gracefully", () => {
415
+ const e = [
416
+ t({ button: void 0 }),
417
+ t({ button: { ...t().button, label: "Valid" } })
418
+ ];
419
+ o(() => r(/* @__PURE__ */ a(b, { tabs: e }))).not.toThrow();
420
+ });
421
+ }), h("Type Safety", () => {
422
+ l("accepts valid Tab array", () => {
423
+ const e = [
424
+ t({ button: { ...t().button, label: "Tab 1" } }),
425
+ t({ button: { ...t().button, label: "Tab 2" } })
426
+ ];
427
+ o(() => r(/* @__PURE__ */ a(b, { tabs: e }))).not.toThrow();
428
+ }), l("accepts onTabChanged callback", () => {
429
+ const e = [t()];
430
+ r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: (d) => {
431
+ o(d).toBeDefined();
432
+ } }));
433
+ }), l("accepts ReactNode as rightSideContent", () => {
434
+ const e = [t()], n = /* @__PURE__ */ a("div", { children: "Content" });
435
+ o(() => r(/* @__PURE__ */ a(b, { rightSideContent: n, tabs: e }))).not.toThrow();
436
+ }), l("handles Tab with all button properties", () => {
437
+ const e = {
438
+ title: "Test",
439
+ content: /* @__PURE__ */ a("div", { children: "Content" }),
440
+ button: {
441
+ label: "Label",
442
+ gradientStartColor: "#000000",
443
+ gradientEndColor: "#ffffff",
444
+ buttonBgColor: "#cccccc",
445
+ buttonHoverBgColor: "#dddddd",
446
+ buttonTextColor: "#111111",
447
+ buttonHoverTextColor: "#222222",
448
+ borderHoverColor: "#333333"
449
+ }
450
+ };
451
+ o(() => r(/* @__PURE__ */ a(b, { tabs: [e] }))).not.toThrow();
452
+ }), l("handles Tab with optional classname", () => {
453
+ const e = {
454
+ title: "Test",
455
+ content: /* @__PURE__ */ a("div", { children: "Content" }),
456
+ classname: "custom-class",
457
+ button: t().button
458
+ };
459
+ o(() => r(/* @__PURE__ */ a(b, { tabs: [e] }))).not.toThrow();
460
+ });
461
+ }), h("Integration Tests", () => {
462
+ l("handles complete tab navigation flow", () => {
463
+ const e = [
464
+ t({
465
+ title: "Videos",
466
+ button: { ...t().button, label: "Videos" }
467
+ }),
468
+ t({
469
+ title: "Photos",
470
+ button: { ...t().button, label: "Photos" }
471
+ }),
472
+ t({
473
+ title: "About",
474
+ button: { ...t().button, label: "About" }
475
+ })
476
+ ], { rerender: n } = r(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s }));
477
+ o(i.getByTestId("gradient-button")).toHaveAttribute("data-label", "Videos");
478
+ let d = i.getAllByTestId("button");
479
+ const g = d.find((v) => v.getAttribute("data-label") === "Photos");
480
+ u.click(g), n(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(i.getByTestId("gradient-button")).toHaveAttribute("data-label", "Photos"), d = i.getAllByTestId("button");
481
+ const B = d.find((v) => v.getAttribute("data-label") === "About");
482
+ u.click(B), n(/* @__PURE__ */ a(b, { tabs: e, onTabChanged: s })), o(i.getByTestId("gradient-button")).toHaveAttribute("data-label", "About"), o(s).toHaveBeenCalledWith(e[0]), o(s).toHaveBeenCalledWith(e[1]), o(s).toHaveBeenCalledWith(e[2]);
483
+ }), l("coordinates with basic-grid-module during navigation", () => {
484
+ const e = [
485
+ t({ button: { ...t().button, label: "Grid 1" } }),
486
+ t({ button: { ...t().button, label: "Grid 2" } })
487
+ ];
488
+ r(/* @__PURE__ */ a(b, { tabs: e })), c.mockClear(), T.mockClear();
489
+ const n = i.getByTestId("button");
490
+ u.click(n), o(c).toHaveBeenCalledWith("basic-grid-module"), o(T).toHaveBeenCalledWith("first-entry", "true"), o(T).toHaveBeenCalledWith("data-state", "entering");
491
+ }), l("renders with rightSideContent and handles navigation", () => {
492
+ const e = [
493
+ t({ button: { ...t().button, label: "Tab 1" } }),
494
+ t({ button: { ...t().button, label: "Tab 2" } })
495
+ ], n = /* @__PURE__ */ a("button", { "data-testid": "action-button", children: "Action" }), { rerender: d } = r(
496
+ /* @__PURE__ */ a(b, { rightSideContent: n, tabs: e })
497
+ );
498
+ o(i.getByTestId("action-button")).toBeInTheDocument();
499
+ const g = i.getByTestId("button");
500
+ u.click(g), d(/* @__PURE__ */ a(b, { rightSideContent: n, tabs: e })), o(i.getByTestId("action-button")).toBeInTheDocument(), o(i.getByTestId("gradient-button")).toHaveAttribute("data-label", "Tab 2");
501
+ }), l("handles all custom colors correctly", () => {
502
+ const e = [
503
+ t({
504
+ button: {
505
+ label: "Current",
506
+ gradientStartColor: "#ff0000",
507
+ gradientEndColor: "#00ff00",
508
+ buttonBgColor: "#aaaaaa",
509
+ buttonHoverBgColor: "#bbbbbb",
510
+ buttonTextColor: "#cccccc",
511
+ buttonHoverTextColor: "#dddddd",
512
+ borderHoverColor: "#eeeeee"
513
+ }
514
+ }),
515
+ t({
516
+ button: {
517
+ label: "Other",
518
+ gradientStartColor: "#111111",
519
+ gradientEndColor: "#222222",
520
+ buttonBgColor: "#333333",
521
+ buttonHoverBgColor: "#444444",
522
+ buttonTextColor: "#555555",
523
+ buttonHoverTextColor: "#666666"
524
+ }
525
+ })
526
+ ], { container: n } = r(/* @__PURE__ */ a(b, { tabs: e })), d = n.querySelectorAll(".tab-navigation__item")[0];
527
+ o(d).toHaveStyle({
528
+ "--gradient-start-color": "#ff0000",
529
+ "--gradient-end-color": "#00ff00"
530
+ });
531
+ const g = i.getByTestId("button");
532
+ o(g).toHaveAttribute("data-bg-color", "#333333"), o(g).toHaveAttribute("data-border-hover-color", "#444444");
533
+ });
534
+ });
535
+ });