@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
@@ -0,0 +1,303 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { v as c, d as s, i as n, r as a, s as i, g as t } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { LogoListItem as l } from "./LogoListItem.js";
4
+ c.mock("../../utils/helpers", () => ({
5
+ classes: (e) => e.filter(Boolean).join(" ")
6
+ }));
7
+ c.mock("./LogoListItem.module.scss", () => ({
8
+ default: {
9
+ "icon-list-item": "icon-list-item-module",
10
+ "icon-list-item__link": "icon-list-item__link-module",
11
+ "ion-list-item__image": "ion-list-item__image-module",
12
+ "icon-list-item__img-wrapper": "icon-list-item__img-wrapper-module"
13
+ }
14
+ }));
15
+ s("LogoListItem", () => {
16
+ s("Basic Rendering", () => {
17
+ n("should render list item element", () => {
18
+ a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" }));
19
+ const e = i.getByRole("listitem");
20
+ t(e).toBeInTheDocument(), t(e.tagName).toBe("LI");
21
+ }), n("should apply list item classes", () => {
22
+ a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" }));
23
+ const e = i.getByRole("listitem");
24
+ t(e).toHaveClass("icon-list-item-module"), t(e).toHaveClass("icon-list-item");
25
+ }), n("should render image with imageSource", () => {
26
+ a(/* @__PURE__ */ o(l, { imageSource: "/test-logo.png" }));
27
+ const e = i.getByRole("img");
28
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("src", "/test-logo.png");
29
+ }), n('should render image with alt text including "logo"', () => {
30
+ a(/* @__PURE__ */ o(l, { altText: "Company", imageSource: "/logo.png" }));
31
+ const e = i.getByRole("img");
32
+ t(e).toHaveAttribute("alt", "Company logo");
33
+ });
34
+ }), s("With href (Link Mode)", () => {
35
+ n("should render link when href is provided", () => {
36
+ a(/* @__PURE__ */ o(l, { href: "https://example.com", imageSource: "/logo.png" }));
37
+ const e = i.getByRole("link");
38
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("href", "https://example.com");
39
+ }), n("should apply link classes", () => {
40
+ a(/* @__PURE__ */ o(l, { href: "https://example.com", imageSource: "/logo.png" }));
41
+ const e = i.getByRole("link");
42
+ t(e).toHaveClass("icon-list-item__link-module"), t(e).toHaveClass("icon-list-item__link");
43
+ }), n("should render sr-only span with altText", () => {
44
+ const { container: e } = a(
45
+ /* @__PURE__ */ o(
46
+ l,
47
+ {
48
+ altText: "Company Name",
49
+ href: "https://example.com",
50
+ imageSource: "/logo.png"
51
+ }
52
+ )
53
+ ), r = e.querySelector(".sr-only");
54
+ t(r).toBeInTheDocument(), t(r).toHaveTextContent("Company Name");
55
+ }), n("should default target to _self", () => {
56
+ a(/* @__PURE__ */ o(l, { href: "https://example.com", imageSource: "/logo.png" }));
57
+ const e = i.getByRole("link");
58
+ t(e).toHaveAttribute("target", "_self");
59
+ }), n("should apply target _blank", () => {
60
+ a(
61
+ /* @__PURE__ */ o(
62
+ l,
63
+ {
64
+ href: "https://example.com",
65
+ imageSource: "/logo.png",
66
+ target: "_blank"
67
+ }
68
+ )
69
+ );
70
+ const e = i.getByRole("link");
71
+ t(e).toHaveAttribute("target", "_blank");
72
+ }), n("should apply target _parent", () => {
73
+ a(
74
+ /* @__PURE__ */ o(
75
+ l,
76
+ {
77
+ href: "https://example.com",
78
+ imageSource: "/logo.png",
79
+ target: "_parent"
80
+ }
81
+ )
82
+ );
83
+ const e = i.getByRole("link");
84
+ t(e).toHaveAttribute("target", "_parent");
85
+ }), n("should apply target _top", () => {
86
+ a(
87
+ /* @__PURE__ */ o(
88
+ l,
89
+ {
90
+ href: "https://example.com",
91
+ imageSource: "/logo.png",
92
+ target: "_top"
93
+ }
94
+ )
95
+ );
96
+ const e = i.getByRole("link");
97
+ t(e).toHaveAttribute("target", "_top");
98
+ }), n("should render image inside link with class", () => {
99
+ a(
100
+ /* @__PURE__ */ o(
101
+ l,
102
+ {
103
+ altText: "Brand",
104
+ href: "https://example.com",
105
+ imageSource: "/logo.png"
106
+ }
107
+ )
108
+ );
109
+ const e = i.getByRole("img");
110
+ t(e).toHaveClass("ion-list-item__image-module"), t(e).toHaveAttribute("alt", "Brand logo"), t(e).toHaveAttribute("src", "/logo.png");
111
+ }), n("should not render span wrapper when href is provided", () => {
112
+ const { container: e } = a(
113
+ /* @__PURE__ */ o(
114
+ l,
115
+ {
116
+ href: "https://example.com",
117
+ imageSource: "/logo.png"
118
+ }
119
+ )
120
+ ), r = e.querySelector(".icon-list-item__img-wrapper");
121
+ t(r).not.toBeInTheDocument();
122
+ });
123
+ }), s("Without href (Span Mode)", () => {
124
+ n("should not render link when href is empty", () => {
125
+ a(/* @__PURE__ */ o(l, { href: "", imageSource: "/logo.png" })), t(i.queryByRole("link")).not.toBeInTheDocument();
126
+ }), n("should not render link when href is not provided", () => {
127
+ a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" })), t(i.queryByRole("link")).not.toBeInTheDocument();
128
+ }), n("should render span wrapper when href is empty", () => {
129
+ const { container: e } = a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" })), r = e.querySelector(".icon-list-item__img-wrapper");
130
+ t(r).toBeInTheDocument(), t(r == null ? void 0 : r.tagName).toBe("SPAN");
131
+ }), n("should apply span wrapper classes", () => {
132
+ const { container: e } = a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" })), r = e.querySelector(".icon-list-item__img-wrapper");
133
+ t(r).toHaveClass("icon-list-item__img-wrapper-module"), t(r).toHaveClass("icon-list-item__img-wrapper");
134
+ }), n("should render image inside span wrapper", () => {
135
+ const { container: e } = a(
136
+ /* @__PURE__ */ o(
137
+ l,
138
+ {
139
+ altText: "Company",
140
+ imageSource: "/logo.png"
141
+ }
142
+ )
143
+ ), r = e.querySelector(".icon-list-item__img-wrapper"), g = i.getByRole("img");
144
+ t(r == null ? void 0 : r.contains(g)).toBe(!0), t(g).toHaveAttribute("alt", "Company logo"), t(g).toHaveAttribute("src", "/logo.png");
145
+ }), n("should not render sr-only span when no href", () => {
146
+ const { container: e } = a(
147
+ /* @__PURE__ */ o(
148
+ l,
149
+ {
150
+ altText: "Company",
151
+ imageSource: "/logo.png"
152
+ }
153
+ )
154
+ ), r = e.querySelector(".sr-only");
155
+ t(r).not.toBeInTheDocument();
156
+ }), n("should not have class on image in span mode", () => {
157
+ const { container: e } = a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" })), r = e.querySelector(".icon-list-item__img-wrapper"), g = r == null ? void 0 : r.querySelector("img");
158
+ t(g == null ? void 0 : g.className).toBe("");
159
+ });
160
+ }), s("Alt Text Handling", () => {
161
+ n("should use empty altText by default", () => {
162
+ a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" }));
163
+ const e = i.getByRole("img");
164
+ t(e).toHaveAttribute("alt", " logo");
165
+ }), n("should use custom altText when provided", () => {
166
+ a(/* @__PURE__ */ o(l, { altText: "My Brand", imageSource: "/logo.png" }));
167
+ const e = i.getByRole("img");
168
+ t(e).toHaveAttribute("alt", "My Brand logo");
169
+ }), n('should append "logo" to altText in link mode', () => {
170
+ a(
171
+ /* @__PURE__ */ o(
172
+ l,
173
+ {
174
+ altText: "Facebook",
175
+ href: "https://example.com",
176
+ imageSource: "/logo.png"
177
+ }
178
+ )
179
+ );
180
+ const e = i.getByRole("img");
181
+ t(e).toHaveAttribute("alt", "Facebook logo");
182
+ }), n('should append "logo" to altText in span mode', () => {
183
+ a(
184
+ /* @__PURE__ */ o(
185
+ l,
186
+ {
187
+ altText: "Twitter",
188
+ imageSource: "/logo.png"
189
+ }
190
+ )
191
+ );
192
+ const e = i.getByRole("img");
193
+ t(e).toHaveAttribute("alt", "Twitter logo");
194
+ }), n("should handle altText with special characters", () => {
195
+ a(/* @__PURE__ */ o(l, { altText: "Company & Co.", imageSource: "/logo.png" }));
196
+ const e = i.getByRole("img");
197
+ t(e).toHaveAttribute("alt", "Company & Co. logo");
198
+ });
199
+ }), s("Image Source Variations", () => {
200
+ n("should handle absolute URLs", () => {
201
+ a(/* @__PURE__ */ o(l, { imageSource: "https://cdn.example.com/logo.png" }));
202
+ const e = i.getByRole("img");
203
+ t(e).toHaveAttribute("src", "https://cdn.example.com/logo.png");
204
+ }), n("should handle relative paths", () => {
205
+ a(/* @__PURE__ */ o(l, { imageSource: "./assets/logo.png" }));
206
+ const e = i.getByRole("img");
207
+ t(e).toHaveAttribute("src", "./assets/logo.png");
208
+ }), n("should handle root-relative paths", () => {
209
+ a(/* @__PURE__ */ o(l, { imageSource: "/images/brand/logo.svg" }));
210
+ const e = i.getByRole("img");
211
+ t(e).toHaveAttribute("src", "/images/brand/logo.svg");
212
+ }), n("should handle different image formats", () => {
213
+ [
214
+ "/logo.png",
215
+ "/logo.jpg",
216
+ "/logo.svg",
217
+ "/logo.webp",
218
+ "/logo.gif"
219
+ ].forEach((r) => {
220
+ const { unmount: g } = a(/* @__PURE__ */ o(l, { imageSource: r })), m = i.getByRole("img");
221
+ t(m).toHaveAttribute("src", r), g();
222
+ });
223
+ });
224
+ }), s("Complete Examples", () => {
225
+ n("should render complete linked logo", () => {
226
+ a(
227
+ /* @__PURE__ */ o(
228
+ l,
229
+ {
230
+ altText: "Facebook",
231
+ href: "https://facebook.com/page",
232
+ imageSource: "/facebook.svg",
233
+ target: "_blank"
234
+ }
235
+ )
236
+ );
237
+ const e = i.getByRole("listitem"), r = i.getByRole("link"), g = i.getByRole("img");
238
+ t(e).toBeInTheDocument(), t(r).toHaveAttribute("href", "https://facebook.com/page"), t(r).toHaveAttribute("target", "_blank"), t(g).toHaveAttribute("src", "/facebook.svg"), t(g).toHaveAttribute("alt", "Facebook logo");
239
+ }), n("should render complete non-linked logo", () => {
240
+ const { container: e } = a(
241
+ /* @__PURE__ */ o(
242
+ l,
243
+ {
244
+ altText: "Partner Company",
245
+ imageSource: "/partner-logo.png"
246
+ }
247
+ )
248
+ ), r = i.getByRole("listitem"), g = e.querySelector(".icon-list-item__img-wrapper"), m = i.getByRole("img");
249
+ t(r).toBeInTheDocument(), t(g).toBeInTheDocument(), t(i.queryByRole("link")).not.toBeInTheDocument(), t(m).toHaveAttribute("src", "/partner-logo.png"), t(m).toHaveAttribute("alt", "Partner Company logo");
250
+ });
251
+ }), s("Edge Cases", () => {
252
+ n("should handle empty imageSource gracefully", () => {
253
+ a(/* @__PURE__ */ o(l, { imageSource: "" }));
254
+ const e = i.getByRole("img");
255
+ t(e).toHaveAttribute("src", "");
256
+ }), n("should handle very long altText", () => {
257
+ const e = "A".repeat(200);
258
+ a(/* @__PURE__ */ o(l, { altText: e, imageSource: "/logo.png" }));
259
+ const r = i.getByRole("img");
260
+ t(r).toHaveAttribute("alt", `${e} logo`);
261
+ }), n("should handle very long href", () => {
262
+ const e = "https://example.com/" + "path/".repeat(50);
263
+ a(/* @__PURE__ */ o(l, { href: e, imageSource: "/logo.png" }));
264
+ const r = i.getByRole("link");
265
+ t(r).toHaveAttribute("href", e);
266
+ }), n("should render correctly when only imageSource is provided", () => {
267
+ a(/* @__PURE__ */ o(l, { imageSource: "/minimal.png" })), t(i.getByRole("listitem")).toBeInTheDocument(), t(i.getByRole("img")).toHaveAttribute("src", "/minimal.png"), t(i.queryByRole("link")).not.toBeInTheDocument();
268
+ }), n("should switch modes when href changes from empty to populated", () => {
269
+ const { rerender: e } = a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" }));
270
+ t(i.queryByRole("link")).not.toBeInTheDocument(), e(/* @__PURE__ */ o(l, { href: "https://example.com", imageSource: "/logo.png" })), t(i.getByRole("link")).toBeInTheDocument();
271
+ });
272
+ }), s("Accessibility", () => {
273
+ n("should provide sr-only text for screen readers in link mode", () => {
274
+ const { container: e } = a(
275
+ /* @__PURE__ */ o(
276
+ l,
277
+ {
278
+ altText: "Company Website",
279
+ href: "https://example.com",
280
+ imageSource: "/logo.png"
281
+ }
282
+ )
283
+ ), r = e.querySelector(".sr-only");
284
+ t(r).toHaveTextContent("Company Website");
285
+ }), n("should have meaningful alt text on image", () => {
286
+ a(
287
+ /* @__PURE__ */ o(
288
+ l,
289
+ {
290
+ altText: "Accessible Company",
291
+ imageSource: "/logo.png"
292
+ }
293
+ )
294
+ );
295
+ const e = i.getByRole("img");
296
+ t(e).toHaveAttribute("alt", "Accessible Company logo");
297
+ }), n("should maintain semantic list structure", () => {
298
+ a(/* @__PURE__ */ o(l, { imageSource: "/logo.png" }));
299
+ const e = i.getByRole("listitem");
300
+ t(e.tagName).toBe("LI");
301
+ });
302
+ });
303
+ });
@@ -0,0 +1,352 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { v as c, d as m, i as n, r as s, g as t, s as r } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { LogoNavigation as i } from "./LogoNavigation.js";
4
+ c.mock("../ImageReplacementAnchor", () => ({
5
+ default: ({ href: l, text: a, image: e, height: g, baselineAdjustment: h, target: d }) => /* @__PURE__ */ o(
6
+ "div",
7
+ {
8
+ "data-baseline": h,
9
+ "data-height": g,
10
+ "data-href": l,
11
+ "data-image-alt": e == null ? void 0 : e.altText,
12
+ "data-image-url": e == null ? void 0 : e.url,
13
+ "data-target": d,
14
+ "data-testid": "image-replacement-anchor",
15
+ "data-text": a,
16
+ children: a
17
+ }
18
+ )
19
+ }));
20
+ c.mock("./LogoNavigation.scss", () => ({}));
21
+ m("LogoNavigation", () => {
22
+ const l = {
23
+ url: "/logo.png",
24
+ altText: "Test Logo",
25
+ aspectRatio: 1
26
+ };
27
+ m("Basic Rendering", () => {
28
+ n("should render logo-navigation custom element", () => {
29
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
30
+ t(e).toBeInTheDocument();
31
+ }), n("should render with default empty items array", () => {
32
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
33
+ t(e == null ? void 0 : e.children).toHaveLength(0);
34
+ }), n("should render with default height of 4rem", () => {
35
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
36
+ t(e).toHaveStyle({ "--logo-nav-max-height": "4rem" });
37
+ }), n("should apply custom height", () => {
38
+ const { container: a } = s(/* @__PURE__ */ o(i, { height: 6 })), e = a.querySelector("logo-navigation");
39
+ t(e).toHaveStyle({ "--logo-nav-max-height": "6rem" });
40
+ }), n("should handle height of 0", () => {
41
+ const { container: a } = s(/* @__PURE__ */ o(i, { height: 0 })), e = a.querySelector("logo-navigation");
42
+ t(e).toHaveStyle({ "--logo-nav-max-height": "0rem" });
43
+ });
44
+ }), m("Items Rendering", () => {
45
+ n("should render single item", () => {
46
+ s(/* @__PURE__ */ o(i, { items: [
47
+ {
48
+ href: "https://example.com",
49
+ image: l,
50
+ text: "Example"
51
+ }
52
+ ] }));
53
+ const e = r.getAllByTestId("image-replacement-anchor");
54
+ t(e).toHaveLength(1);
55
+ }), n("should render multiple items", () => {
56
+ s(/* @__PURE__ */ o(i, { items: [
57
+ { href: "https://example1.com", image: l, text: "Example 1" },
58
+ { href: "https://example2.com", image: l, text: "Example 2" },
59
+ { href: "https://example3.com", image: l, text: "Example 3" }
60
+ ] }));
61
+ const e = r.getAllByTestId("image-replacement-anchor");
62
+ t(e).toHaveLength(3);
63
+ }), n("should not render when items array is empty", () => {
64
+ s(/* @__PURE__ */ o(i, { items: [] }));
65
+ const a = r.queryAllByTestId("image-replacement-anchor");
66
+ t(a).toHaveLength(0);
67
+ }), n("should not render when items is not provided", () => {
68
+ s(/* @__PURE__ */ o(i, {}));
69
+ const a = r.queryAllByTestId("image-replacement-anchor");
70
+ t(a).toHaveLength(0);
71
+ });
72
+ }), m("ImageReplacementAnchor Props", () => {
73
+ n("should pass href to ImageReplacementAnchor", () => {
74
+ s(/* @__PURE__ */ o(i, { items: [
75
+ {
76
+ href: "https://test.com",
77
+ image: l
78
+ }
79
+ ] }));
80
+ const e = r.getByTestId("image-replacement-anchor");
81
+ t(e).toHaveAttribute("data-href", "https://test.com");
82
+ }), n("should pass text to ImageReplacementAnchor", () => {
83
+ s(/* @__PURE__ */ o(i, { items: [
84
+ {
85
+ image: l,
86
+ text: "Logo Text"
87
+ }
88
+ ] }));
89
+ const e = r.getByTestId("image-replacement-anchor");
90
+ t(e).toHaveAttribute("data-text", "Logo Text"), t(e).toHaveTextContent("Logo Text");
91
+ }), n("should pass image object to ImageReplacementAnchor", () => {
92
+ s(/* @__PURE__ */ o(i, { items: [
93
+ {
94
+ image: {
95
+ url: "/custom-logo.svg",
96
+ altText: "Custom Logo",
97
+ aspectRatio: 1
98
+ }
99
+ }
100
+ ] }));
101
+ const g = r.getByTestId("image-replacement-anchor");
102
+ t(g).toHaveAttribute("data-image-url", "/custom-logo.svg"), t(g).toHaveAttribute("data-image-alt", "Custom Logo");
103
+ }), n("should pass height to ImageReplacementAnchor", () => {
104
+ s(/* @__PURE__ */ o(i, { items: [
105
+ {
106
+ image: l,
107
+ height: 100
108
+ }
109
+ ] }));
110
+ const e = r.getByTestId("image-replacement-anchor");
111
+ t(e).toHaveAttribute("data-height", "100");
112
+ }), n("should pass baselineAdjustment when provided", () => {
113
+ s(/* @__PURE__ */ o(i, { items: [
114
+ {
115
+ image: l,
116
+ baselineAdjustment: 5
117
+ }
118
+ ] }));
119
+ const e = r.getByTestId("image-replacement-anchor");
120
+ t(e).toHaveAttribute("data-baseline", "5");
121
+ }), n("should default baselineAdjustment to 0 when not provided", () => {
122
+ s(/* @__PURE__ */ o(i, { items: [
123
+ {
124
+ image: l
125
+ }
126
+ ] }));
127
+ const e = r.getByTestId("image-replacement-anchor");
128
+ t(e).toHaveAttribute("data-baseline", "0");
129
+ }), n("should pass target when provided", () => {
130
+ s(/* @__PURE__ */ o(i, { items: [
131
+ {
132
+ image: l,
133
+ target: "_blank"
134
+ }
135
+ ] }));
136
+ const e = r.getByTestId("image-replacement-anchor");
137
+ t(e).toHaveAttribute("data-target", "_blank");
138
+ }), n("should default target to _self when not provided", () => {
139
+ s(/* @__PURE__ */ o(i, { items: [
140
+ {
141
+ image: l
142
+ }
143
+ ] }));
144
+ const e = r.getByTestId("image-replacement-anchor");
145
+ t(e).toHaveAttribute("data-target", "_self");
146
+ });
147
+ }), m("Target Attribute Values", () => {
148
+ n("should handle target _self", () => {
149
+ s(/* @__PURE__ */ o(i, { items: [
150
+ {
151
+ image: l,
152
+ target: "_self"
153
+ }
154
+ ] }));
155
+ const e = r.getByTestId("image-replacement-anchor");
156
+ t(e).toHaveAttribute("data-target", "_self");
157
+ }), n("should handle target _blank", () => {
158
+ s(/* @__PURE__ */ o(i, { items: [
159
+ {
160
+ image: l,
161
+ target: "_blank"
162
+ }
163
+ ] }));
164
+ const e = r.getByTestId("image-replacement-anchor");
165
+ t(e).toHaveAttribute("data-target", "_blank");
166
+ }), n("should handle target _parent", () => {
167
+ s(/* @__PURE__ */ o(i, { items: [
168
+ {
169
+ image: l,
170
+ target: "_parent"
171
+ }
172
+ ] }));
173
+ const e = r.getByTestId("image-replacement-anchor");
174
+ t(e).toHaveAttribute("data-target", "_parent");
175
+ }), n("should handle target _top", () => {
176
+ s(/* @__PURE__ */ o(i, { items: [
177
+ {
178
+ image: l,
179
+ target: "_top"
180
+ }
181
+ ] }));
182
+ const e = r.getByTestId("image-replacement-anchor");
183
+ t(e).toHaveAttribute("data-target", "_top");
184
+ });
185
+ }), m("Complete Items", () => {
186
+ n("should render item with all properties", () => {
187
+ s(/* @__PURE__ */ o(i, { items: [
188
+ {
189
+ href: "https://example.com",
190
+ target: "_blank",
191
+ image: l,
192
+ text: "Example Logo",
193
+ height: 50,
194
+ baselineAdjustment: 3
195
+ }
196
+ ] }));
197
+ const e = r.getByTestId("image-replacement-anchor");
198
+ t(e).toHaveAttribute("data-href", "https://example.com"), t(e).toHaveAttribute("data-target", "_blank"), t(e).toHaveAttribute("data-image-url", "/logo.png"), t(e).toHaveAttribute("data-image-alt", "Test Logo"), t(e).toHaveAttribute("data-text", "Example Logo"), t(e).toHaveAttribute("data-height", "50"), t(e).toHaveAttribute("data-baseline", "3");
199
+ }), n("should render item with minimal properties", () => {
200
+ s(/* @__PURE__ */ o(i, { items: [
201
+ {
202
+ image: l
203
+ }
204
+ ] }));
205
+ const e = r.getByTestId("image-replacement-anchor");
206
+ t(e).toHaveAttribute("data-image-url", "/logo.png"), t(e).toHaveAttribute("data-baseline", "0"), t(e).toHaveAttribute("data-target", "_self");
207
+ }), n("should render multiple items with different properties", () => {
208
+ s(/* @__PURE__ */ o(i, { items: [
209
+ {
210
+ href: "https://site1.com",
211
+ image: { url: "/logo1.png", altText: "Logo 1", aspectRatio: 1 },
212
+ text: "Site 1",
213
+ height: 40
214
+ },
215
+ {
216
+ href: "https://site2.com",
217
+ image: { url: "/logo2.png", altText: "Logo 2", aspectRatio: 1 },
218
+ text: "Site 2",
219
+ target: "_blank"
220
+ },
221
+ {
222
+ image: { url: "/logo3.png", altText: "Logo 3", aspectRatio: 1 },
223
+ baselineAdjustment: 2
224
+ }
225
+ ] }));
226
+ const e = r.getAllByTestId("image-replacement-anchor");
227
+ t(e).toHaveLength(3), t(e[0]).toHaveAttribute("data-href", "https://site1.com"), t(e[0]).toHaveAttribute("data-height", "40"), t(e[1]).toHaveAttribute("data-target", "_blank"), t(e[1]).toHaveAttribute("data-image-url", "/logo2.png"), t(e[2]).toHaveAttribute("data-baseline", "2"), t(e[2]).toHaveAttribute("data-image-url", "/logo3.png");
228
+ });
229
+ }), m("CSS Custom Properties", () => {
230
+ n("should set --logo-nav-max-height with default height", () => {
231
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
232
+ t(e).toHaveStyle({ "--logo-nav-max-height": "4rem" });
233
+ }), n("should set --logo-nav-max-height with custom height", () => {
234
+ const { container: a } = s(/* @__PURE__ */ o(i, { height: 8 })), e = a.querySelector("logo-navigation");
235
+ t(e).toHaveStyle({ "--logo-nav-max-height": "8rem" });
236
+ }), n("should handle decimal height values", () => {
237
+ const { container: a } = s(/* @__PURE__ */ o(i, { height: 3.5 })), e = a.querySelector("logo-navigation");
238
+ t(e).toHaveStyle({ "--logo-nav-max-height": "3.5rem" });
239
+ }), n("should handle very large height values", () => {
240
+ const { container: a } = s(/* @__PURE__ */ o(i, { height: 100 })), e = a.querySelector("logo-navigation");
241
+ t(e).toHaveStyle({ "--logo-nav-max-height": "100rem" });
242
+ });
243
+ }), m("Integration", () => {
244
+ n("should render navigation with items and custom height", () => {
245
+ const a = [
246
+ {
247
+ href: "https://example.com",
248
+ image: l,
249
+ text: "Example"
250
+ }
251
+ ], { container: e } = s(/* @__PURE__ */ o(i, { height: 5, items: a })), g = e.querySelector("logo-navigation");
252
+ t(g).toHaveStyle({ "--logo-nav-max-height": "5rem" }), t(r.getAllByTestId("image-replacement-anchor")).toHaveLength(1);
253
+ }), n("should render multiple logos with different configurations", () => {
254
+ const a = [
255
+ {
256
+ href: "https://facebook.com",
257
+ image: { url: "/fb.svg", altText: "Facebook", aspectRatio: 1 },
258
+ text: "Facebook",
259
+ target: "_blank",
260
+ height: 48
261
+ },
262
+ {
263
+ href: "https://twitter.com",
264
+ image: { url: "/tw.svg", altText: "Twitter", aspectRatio: 1 },
265
+ text: "Twitter",
266
+ target: "_blank",
267
+ baselineAdjustment: 2
268
+ }
269
+ ], { container: e } = s(/* @__PURE__ */ o(i, { height: 6, items: a })), g = e.querySelector("logo-navigation"), h = r.getAllByTestId("image-replacement-anchor");
270
+ t(g).toHaveStyle({ "--logo-nav-max-height": "6rem" }), t(h).toHaveLength(2), t(h[0]).toHaveTextContent("Facebook"), t(h[1]).toHaveTextContent("Twitter");
271
+ });
272
+ }), m("Edge Cases", () => {
273
+ n("should handle empty items array", () => {
274
+ s(/* @__PURE__ */ o(i, { items: [] }));
275
+ const a = r.queryAllByTestId("image-replacement-anchor");
276
+ t(a).toHaveLength(0);
277
+ }), n("should handle undefined items", () => {
278
+ s(/* @__PURE__ */ o(i, { items: void 0 }));
279
+ const a = r.queryAllByTestId("image-replacement-anchor");
280
+ t(a).toHaveLength(0);
281
+ }), n("should handle large number of items", () => {
282
+ const a = Array.from({ length: 20 }, (g, h) => ({
283
+ href: `https://example${h}.com`,
284
+ image: { url: `/logo${h}.png`, altText: `Logo ${h}`, aspectRatio: 1 },
285
+ text: `Logo ${h}`
286
+ }));
287
+ s(/* @__PURE__ */ o(i, { items: a }));
288
+ const e = r.getAllByTestId("image-replacement-anchor");
289
+ t(e).toHaveLength(20);
290
+ }), n("should handle item with undefined optional properties", () => {
291
+ s(/* @__PURE__ */ o(i, { items: [
292
+ {
293
+ image: l,
294
+ href: void 0,
295
+ text: void 0,
296
+ height: void 0,
297
+ baselineAdjustment: void 0,
298
+ target: void 0
299
+ }
300
+ ] }));
301
+ const e = r.getByTestId("image-replacement-anchor");
302
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("data-baseline", "0"), t(e).toHaveAttribute("data-target", "_self");
303
+ }), n("should handle baselineAdjustment of 0", () => {
304
+ s(/* @__PURE__ */ o(i, { items: [
305
+ {
306
+ image: l,
307
+ baselineAdjustment: 0
308
+ }
309
+ ] }));
310
+ const e = r.getByTestId("image-replacement-anchor");
311
+ t(e).toHaveAttribute("data-baseline", "0");
312
+ }), n("should handle negative baselineAdjustment", () => {
313
+ s(/* @__PURE__ */ o(i, { items: [
314
+ {
315
+ image: l,
316
+ baselineAdjustment: -3
317
+ }
318
+ ] }));
319
+ const e = r.getByTestId("image-replacement-anchor");
320
+ t(e).toHaveAttribute("data-baseline", "-3");
321
+ }), n("should handle height of 0", () => {
322
+ s(/* @__PURE__ */ o(i, { items: [
323
+ {
324
+ image: l,
325
+ height: 0
326
+ }
327
+ ] }));
328
+ const e = r.getByTestId("image-replacement-anchor");
329
+ t(e).toHaveAttribute("data-height", "0");
330
+ }), n("should handle empty href string", () => {
331
+ s(/* @__PURE__ */ o(i, { items: [
332
+ {
333
+ image: l,
334
+ href: ""
335
+ }
336
+ ] }));
337
+ const e = r.getByTestId("image-replacement-anchor");
338
+ t(e).toHaveAttribute("data-href", "");
339
+ });
340
+ }), m("Default Props", () => {
341
+ n("should use default items array when not provided", () => {
342
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
343
+ t(e == null ? void 0 : e.children).toHaveLength(0);
344
+ }), n("should use default height of 4 when not provided", () => {
345
+ const { container: a } = s(/* @__PURE__ */ o(i, {})), e = a.querySelector("logo-navigation");
346
+ t(e).toHaveStyle({ "--logo-nav-max-height": "4rem" });
347
+ }), n("should override defaults when props provided", () => {
348
+ const a = [{ image: l }], { container: e } = s(/* @__PURE__ */ o(i, { height: 10, items: a })), g = e.querySelector("logo-navigation");
349
+ t(g).toHaveStyle({ "--logo-nav-max-height": "10rem" }), t(r.getAllByTestId("image-replacement-anchor")).toHaveLength(1);
350
+ });
351
+ });
352
+ });
@@ -1,9 +1,9 @@
1
1
  import { jsx as s, jsxs as k, Fragment as B } from "react/jsx-runtime";
2
2
  import { useState as i, useRef as x, useEffect as v, Suspense as M, Children as w, isValidElement as F, cloneElement as K } from "react";
3
- import { r as N } from "../../index-C-kn9Zhn.mjs";
3
+ import { r as N } from "../../index-DzfYkULW.mjs";
4
4
  import { classes as D } from "../../utils/helpers.js";
5
5
  import { blockLayoutsMap as q } from "../../settings.js";
6
- import { X as R } from "../../x-C-QzJ-qD.mjs";
6
+ import { X as R } from "../../x-Ck9Vk5Fo.mjs";
7
7
  import '../../assets/ModalContainer.css';const T = "_modal_ojmou_1", C = {
8
8
  modal: T,
9
9
  "modal__close-btn": "_modal__close-btn_ojmou_48"