@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,358 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { d as s, b as m, a as g, i as d, r, g as i } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { EqualSizeGrid as n } from "./EqualSizeGrid.js";
5
+ s("EqualSizeGrid", () => {
6
+ let a;
7
+ m(() => {
8
+ a = document.createElement("div"), a.id = "root", document.body.appendChild(a);
9
+ }), g(() => {
10
+ document.body.removeChild(a);
11
+ }), s("Basic Rendering", () => {
12
+ d("should render the custom element", () => {
13
+ r(/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("div", { children: "Child" }) }));
14
+ const t = document.querySelector("equal-size-grid");
15
+ i(t).toBeInTheDocument();
16
+ }), d("should render single child", () => {
17
+ const { container: t } = r(
18
+ /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("div", { children: "Child 1" }) })
19
+ );
20
+ i(t.textContent).toContain("Child 1");
21
+ }), d("should render multiple children", () => {
22
+ const { container: t } = r(
23
+ /* @__PURE__ */ o(n, { children: [
24
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
25
+ /* @__PURE__ */ e("div", { children: "Child 2" }),
26
+ /* @__PURE__ */ e("div", { children: "Child 3" })
27
+ ] })
28
+ );
29
+ i(t.textContent).toContain("Child 1"), i(t.textContent).toContain("Child 2"), i(t.textContent).toContain("Child 3");
30
+ }), d("should wrap each child in equal-size-grid__item div", () => {
31
+ r(
32
+ /* @__PURE__ */ o(n, { children: [
33
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
34
+ /* @__PURE__ */ e("div", { children: "Child 2" })
35
+ ] })
36
+ );
37
+ const t = document.querySelectorAll(".equal-size-grid__item");
38
+ i(t.length).toBe(2);
39
+ }), d("should set data-item-count attribute", () => {
40
+ r(
41
+ /* @__PURE__ */ o(n, { children: [
42
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
43
+ /* @__PURE__ */ e("div", { children: "Child 2" }),
44
+ /* @__PURE__ */ e("div", { children: "Child 3" })
45
+ ] })
46
+ );
47
+ const t = document.querySelector("equal-size-grid");
48
+ i(t).toHaveAttribute("data-item-count", "3");
49
+ });
50
+ }), s("Gap Prop", () => {
51
+ d("should use default gap of 1.5rem", () => {
52
+ r(
53
+ /* @__PURE__ */ o(n, { children: [
54
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
55
+ /* @__PURE__ */ e("div", { children: "Child 2" })
56
+ ] })
57
+ );
58
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
59
+ i(l).toContain("--esg-gap-size: 1.5rem");
60
+ }), d("should apply custom gap value", () => {
61
+ r(
62
+ /* @__PURE__ */ o(n, { gap: "2rem", children: [
63
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
64
+ /* @__PURE__ */ e("div", { children: "Child 2" })
65
+ ] })
66
+ );
67
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
68
+ i(l).toContain("--esg-gap-size: 2rem");
69
+ }), d("should handle gap with different units", () => {
70
+ r(
71
+ /* @__PURE__ */ o(n, { gap: "20px", children: [
72
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
73
+ /* @__PURE__ */ e("div", { children: "Child 2" })
74
+ ] })
75
+ );
76
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
77
+ i(l).toContain("--esg-gap-size: 20px");
78
+ }), d("should handle gap of 0", () => {
79
+ r(
80
+ /* @__PURE__ */ o(n, { gap: "0", children: [
81
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
82
+ /* @__PURE__ */ e("div", { children: "Child 2" })
83
+ ] })
84
+ );
85
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
86
+ i(l).toContain("--esg-gap-size: 0");
87
+ });
88
+ }), s("ItemsPerRow Prop", () => {
89
+ d("should use default itemsPerRow of 4", () => {
90
+ r(
91
+ /* @__PURE__ */ o(n, { children: [
92
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
93
+ /* @__PURE__ */ e("div", { children: "Child 2" })
94
+ ] })
95
+ );
96
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
97
+ i(l).toContain("--esg-template-columns: repeat(4, 1fr)");
98
+ }), d("should apply custom itemsPerRow value", () => {
99
+ r(
100
+ /* @__PURE__ */ o(n, { itemsPerRow: 3, children: [
101
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
102
+ /* @__PURE__ */ e("div", { children: "Child 2" }),
103
+ /* @__PURE__ */ e("div", { children: "Child 3" })
104
+ ] })
105
+ );
106
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
107
+ i(l).toContain("--esg-template-columns: repeat(3, 1fr)");
108
+ }), d("should handle itemsPerRow of 1", () => {
109
+ r(
110
+ /* @__PURE__ */ o(n, { itemsPerRow: 1, children: [
111
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
112
+ /* @__PURE__ */ e("div", { children: "Child 2" })
113
+ ] })
114
+ );
115
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
116
+ i(l).toContain("--esg-template-columns: repeat(1, 1fr)");
117
+ }), d("should handle itemsPerRow of 6", () => {
118
+ r(
119
+ /* @__PURE__ */ o(n, { itemsPerRow: 6, children: [
120
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
121
+ /* @__PURE__ */ e("div", { children: "Child 2" })
122
+ ] })
123
+ );
124
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
125
+ i(l).toContain("--esg-template-columns: repeat(6, 1fr)");
126
+ }), d("should handle large itemsPerRow values", () => {
127
+ r(
128
+ /* @__PURE__ */ o(n, { itemsPerRow: 12, children: [
129
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
130
+ /* @__PURE__ */ e("div", { children: "Child 2" })
131
+ ] })
132
+ );
133
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
134
+ i(l).toContain("--esg-template-columns: repeat(12, 1fr)");
135
+ });
136
+ }), s("Classname Prop", () => {
137
+ d("should not set class attribute when classname not provided", () => {
138
+ r(
139
+ /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("div", { children: "Child 1" }) })
140
+ );
141
+ const t = document.querySelector("equal-size-grid");
142
+ i(t).toHaveAttribute("class", "");
143
+ }), d("should apply custom classname", () => {
144
+ r(
145
+ /* @__PURE__ */ o(n, { classname: "custom-grid", children: [
146
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
147
+ /* @__PURE__ */ e("div", { children: "Child 2" })
148
+ ] })
149
+ );
150
+ const t = document.querySelector("equal-size-grid");
151
+ i(t).toHaveAttribute("class", "custom-grid");
152
+ }), d("should apply multiple classnames", () => {
153
+ r(
154
+ /* @__PURE__ */ e(n, { classname: "custom-grid another-class", children: /* @__PURE__ */ e("div", { children: "Child 1" }) })
155
+ );
156
+ const t = document.querySelector("equal-size-grid");
157
+ i(t).toHaveAttribute("class", "custom-grid another-class");
158
+ });
159
+ }), s("CSS Custom Properties", () => {
160
+ d("should set both CSS custom properties", () => {
161
+ r(
162
+ /* @__PURE__ */ o(n, { gap: "2rem", itemsPerRow: 3, children: [
163
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
164
+ /* @__PURE__ */ e("div", { children: "Child 2" })
165
+ ] })
166
+ );
167
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
168
+ i(l).toContain("--esg-gap-size: 2rem"), i(l).toContain("--esg-template-columns: repeat(3, 1fr)");
169
+ }), d("should update CSS properties when props change", () => {
170
+ const { rerender: t } = r(
171
+ /* @__PURE__ */ o(n, { gap: "1rem", itemsPerRow: 3, children: [
172
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
173
+ /* @__PURE__ */ e("div", { children: "Child 2" })
174
+ ] })
175
+ );
176
+ let l = document.querySelector("equal-size-grid"), c = l.getAttribute("style");
177
+ i(c).toContain("--esg-gap-size: 1rem"), i(c).toContain("--esg-template-columns: repeat(3, 1fr)"), t(
178
+ /* @__PURE__ */ o(n, { gap: "3rem", itemsPerRow: 5, children: [
179
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
180
+ /* @__PURE__ */ e("div", { children: "Child 2" })
181
+ ] })
182
+ ), l = document.querySelector("equal-size-grid"), c = l.getAttribute("style"), i(c).toContain("--esg-gap-size: 3rem"), i(c).toContain("--esg-template-columns: repeat(5, 1fr)");
183
+ });
184
+ }), s("Children Handling", () => {
185
+ d("should handle React elements as children", () => {
186
+ const { container: t } = r(
187
+ /* @__PURE__ */ o(n, { children: [
188
+ /* @__PURE__ */ e("button", { children: "Button 1" }),
189
+ /* @__PURE__ */ e("button", { children: "Button 2" })
190
+ ] })
191
+ ), l = t.querySelectorAll("button");
192
+ i(l.length).toBe(2);
193
+ }), d("should handle text nodes as children", () => {
194
+ const { container: t } = r(
195
+ /* @__PURE__ */ o(n, { children: [
196
+ /* @__PURE__ */ e("span", { children: "Text 1" }),
197
+ /* @__PURE__ */ e("span", { children: "Text 2" })
198
+ ] })
199
+ );
200
+ i(t.textContent).toContain("Text 1"), i(t.textContent).toContain("Text 2");
201
+ }), d("should preserve child props when cloning", () => {
202
+ const { container: t } = r(
203
+ /* @__PURE__ */ o(n, { children: [
204
+ /* @__PURE__ */ e("div", { className: "custom-class", "data-testid": "child1", children: "Child 1" }),
205
+ /* @__PURE__ */ e("div", { className: "another-class", "data-testid": "child2", children: "Child 2" })
206
+ ] })
207
+ ), l = t.querySelector('[data-testid="child1"]'), c = t.querySelector('[data-testid="child2"]');
208
+ i(l).toHaveClass("custom-class"), i(c).toHaveClass("another-class");
209
+ }), d("should handle mixed content types", () => {
210
+ const { container: t } = r(
211
+ /* @__PURE__ */ o(n, { children: [
212
+ /* @__PURE__ */ e("div", { children: "Div element" }),
213
+ /* @__PURE__ */ e("button", { children: "Button element" }),
214
+ /* @__PURE__ */ e("span", { children: "Span element" })
215
+ ] })
216
+ );
217
+ i(t.querySelector("div")).toBeInTheDocument(), i(t.querySelector("button")).toBeInTheDocument(), i(t.querySelector("span")).toBeInTheDocument();
218
+ }), d("should handle single child", () => {
219
+ const { container: t } = r(
220
+ /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("div", { children: "Only Child" }) })
221
+ ), l = t.querySelectorAll(".equal-size-grid__item");
222
+ i(l.length).toBe(1), i(t.textContent).toContain("Only Child");
223
+ });
224
+ }), s("Grid Layout Behavior", () => {
225
+ d("should create grid with 4 columns by default", () => {
226
+ r(
227
+ /* @__PURE__ */ o(n, { children: [
228
+ /* @__PURE__ */ e("div", { children: "1" }),
229
+ /* @__PURE__ */ e("div", { children: "2" }),
230
+ /* @__PURE__ */ e("div", { children: "3" }),
231
+ /* @__PURE__ */ e("div", { children: "4" }),
232
+ /* @__PURE__ */ e("div", { children: "5" })
233
+ ] })
234
+ );
235
+ const l = document.querySelector("equal-size-grid").getAttribute("style");
236
+ i(l).toContain("repeat(4, 1fr)");
237
+ }), d("should handle more children than itemsPerRow", () => {
238
+ r(
239
+ /* @__PURE__ */ o(n, { itemsPerRow: 3, children: [
240
+ /* @__PURE__ */ e("div", { children: "1" }),
241
+ /* @__PURE__ */ e("div", { children: "2" }),
242
+ /* @__PURE__ */ e("div", { children: "3" }),
243
+ /* @__PURE__ */ e("div", { children: "4" }),
244
+ /* @__PURE__ */ e("div", { children: "5" }),
245
+ /* @__PURE__ */ e("div", { children: "6" }),
246
+ /* @__PURE__ */ e("div", { children: "7" })
247
+ ] })
248
+ );
249
+ const t = document.querySelector("equal-size-grid");
250
+ i(t).toHaveAttribute("data-item-count", "7");
251
+ const l = document.querySelectorAll(".equal-size-grid__item");
252
+ i(l.length).toBe(7);
253
+ }), d("should handle fewer children than itemsPerRow", () => {
254
+ r(
255
+ /* @__PURE__ */ o(n, { itemsPerRow: 5, children: [
256
+ /* @__PURE__ */ e("div", { children: "1" }),
257
+ /* @__PURE__ */ e("div", { children: "2" })
258
+ ] })
259
+ );
260
+ const t = document.querySelector("equal-size-grid");
261
+ i(t).toHaveAttribute("data-item-count", "2");
262
+ const l = document.querySelectorAll(".equal-size-grid__item");
263
+ i(l.length).toBe(2);
264
+ });
265
+ }), s("Edge Cases", () => {
266
+ d("should handle zero children gracefully", () => {
267
+ r(/* @__PURE__ */ e(n, { children: [] }));
268
+ const t = document.querySelector("equal-size-grid");
269
+ i(t).toBeInTheDocument(), i(t).toHaveAttribute("data-item-count", "0");
270
+ }), d("should handle very large number of children", () => {
271
+ const t = Array.from({ length: 50 }, (h, u) => /* @__PURE__ */ o("div", { children: [
272
+ "Child ",
273
+ u + 1
274
+ ] }, u));
275
+ r(
276
+ /* @__PURE__ */ e(n, { itemsPerRow: 4, children: t })
277
+ );
278
+ const l = document.querySelector("equal-size-grid");
279
+ i(l).toHaveAttribute("data-item-count", "50");
280
+ const c = document.querySelectorAll(".equal-size-grid__item");
281
+ i(c.length).toBe(50);
282
+ }), d("should handle null children", () => {
283
+ r(
284
+ /* @__PURE__ */ o(n, { children: [
285
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
286
+ null,
287
+ /* @__PURE__ */ e("div", { children: "Child 2" })
288
+ ] })
289
+ );
290
+ const t = document.querySelector("equal-size-grid");
291
+ i(t).toHaveAttribute("data-item-count", "2");
292
+ }), d("should handle undefined children", () => {
293
+ r(
294
+ /* @__PURE__ */ o(n, { children: [
295
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
296
+ void 0,
297
+ /* @__PURE__ */ e("div", { children: "Child 2" })
298
+ ] })
299
+ );
300
+ const t = document.querySelector("equal-size-grid");
301
+ i(t).toHaveAttribute("data-item-count", "2");
302
+ }), d("should handle boolean children", () => {
303
+ r(
304
+ /* @__PURE__ */ o(n, { children: [
305
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
306
+ !1,
307
+ !0,
308
+ /* @__PURE__ */ e("div", { children: "Child 2" })
309
+ ] })
310
+ );
311
+ const t = document.querySelector("equal-size-grid");
312
+ i(t).toHaveAttribute("data-item-count", "2");
313
+ });
314
+ }), s("Integration", () => {
315
+ d("should correctly render with all props and multiple children", () => {
316
+ const { container: t } = r(
317
+ /* @__PURE__ */ o(n, { classname: "custom-grid-class", gap: "2.5rem", itemsPerRow: 3, children: [
318
+ /* @__PURE__ */ e("div", { className: "item-1", children: "Item 1" }),
319
+ /* @__PURE__ */ e("div", { className: "item-2", children: "Item 2" }),
320
+ /* @__PURE__ */ e("div", { className: "item-3", children: "Item 3" }),
321
+ /* @__PURE__ */ e("div", { className: "item-4", children: "Item 4" }),
322
+ /* @__PURE__ */ e("div", { className: "item-5", children: "Item 5" }),
323
+ /* @__PURE__ */ e("div", { className: "item-6", children: "Item 6" })
324
+ ] })
325
+ ), l = document.querySelector("equal-size-grid");
326
+ i(l).toHaveAttribute("data-item-count", "6"), i(l).toHaveAttribute("class", "custom-grid-class");
327
+ const c = l.getAttribute("style");
328
+ i(c).toContain("--esg-gap-size: 2.5rem"), i(c).toContain("--esg-template-columns: repeat(3, 1fr)");
329
+ const h = t.querySelectorAll(".equal-size-grid__item");
330
+ i(h.length).toBe(6), i(t.querySelector(".item-1")).toBeInTheDocument(), i(t.querySelector(".item-2")).toBeInTheDocument(), i(t.querySelector(".item-3")).toBeInTheDocument(), i(t.querySelector(".item-4")).toBeInTheDocument(), i(t.querySelector(".item-5")).toBeInTheDocument(), i(t.querySelector(".item-6")).toBeInTheDocument();
331
+ }), d("should handle dynamic children updates", () => {
332
+ const { rerender: t, container: l } = r(
333
+ /* @__PURE__ */ o(n, { itemsPerRow: 3, children: [
334
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
335
+ /* @__PURE__ */ e("div", { children: "Child 2" })
336
+ ] })
337
+ );
338
+ let c = document.querySelector("equal-size-grid");
339
+ i(c).toHaveAttribute("data-item-count", "2"), t(
340
+ /* @__PURE__ */ o(n, { itemsPerRow: 3, children: [
341
+ /* @__PURE__ */ e("div", { children: "Child 1" }),
342
+ /* @__PURE__ */ e("div", { children: "Child 2" }),
343
+ /* @__PURE__ */ e("div", { children: "Child 3" }),
344
+ /* @__PURE__ */ e("div", { children: "Child 4" }),
345
+ /* @__PURE__ */ e("div", { children: "Child 5" })
346
+ ] })
347
+ ), c = document.querySelector("equal-size-grid"), i(c).toHaveAttribute("data-item-count", "5");
348
+ const h = l.querySelectorAll(".equal-size-grid__item");
349
+ i(h.length).toBe(5);
350
+ }), d("should handle all props with edge case values", () => {
351
+ r(
352
+ /* @__PURE__ */ e(n, { classname: "", gap: "0", itemsPerRow: 1, children: /* @__PURE__ */ e("div", { children: "Single Item" }) })
353
+ );
354
+ const t = document.querySelector("equal-size-grid"), l = t.getAttribute("style");
355
+ i(l).toContain("--esg-gap-size: 0"), i(l).toContain("--esg-template-columns: repeat(1, 1fr)"), i(t).toHaveAttribute("class", ""), i(t).toHaveAttribute("data-item-count", "1");
356
+ });
357
+ });
358
+ });
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { p as _ } from "../../index-VjANCDXC.mjs";
2
+ import { p as _ } from "../../index-06PEPfBQ.mjs";
3
3
  import { classes as e } from "../../utils/helpers.js";
4
4
  import '../../assets/ErrorHandler.css';const s = {
5
5
  "error-handler__message": "_error-handler__message_4uq8z_1"
@@ -7,7 +7,7 @@ import '../../assets/ErrorHandler.css';const s = {
7
7
  function m({ title: a, message: l }) {
8
8
  return /* @__PURE__ */ r("error-handler", { children: /* @__PURE__ */ o("div", { className: e([s["error-handler__message"], "error-handler__message"]), children: [
9
9
  /* @__PURE__ */ r("h2", { className: e([s["error-handler__title"], "error-handler__title"]), children: a }),
10
- /* @__PURE__ */ r("p", { className: e([s["error-handler__message-text"], "error-handler__message-text"]), children: _(l) })
10
+ /* @__PURE__ */ r("div", { className: e([s["error-handler__message-text"], "error-handler__message-text"]), children: _(l) })
11
11
  ] }) });
12
12
  }
13
13
  export {
@@ -0,0 +1,158 @@
1
+ import { jsx as r, jsxs as d, Fragment as u } from "react/jsx-runtime";
2
+ import { d as m, b as T, a as B, i as n, r as s, g as e, s as a, v as y } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { ErrorHandler as o } from "./ErrorHandler.js";
5
+ m("ErrorHandler", () => {
6
+ let g;
7
+ T(() => {
8
+ g = document.createElement("div"), g.id = "root", document.body.appendChild(g);
9
+ }), B(() => {
10
+ document.body.removeChild(g);
11
+ }), m("Basic Rendering", () => {
12
+ n("should render the custom error-handler element", () => {
13
+ s(/* @__PURE__ */ r(o, { message: "Something went wrong", title: "Error" }));
14
+ const t = document.querySelector("error-handler");
15
+ e(t).toBeInTheDocument();
16
+ }), n("should render title", () => {
17
+ s(/* @__PURE__ */ r(o, { message: "Test message", title: "Test Error" })), e(a.getByText("Test Error")).toBeInTheDocument();
18
+ }), n("should render message", () => {
19
+ s(/* @__PURE__ */ r(o, { message: "Something went wrong", title: "Error" })), e(a.getByText("Something went wrong")).toBeInTheDocument();
20
+ }), n("should render title in h2 element", () => {
21
+ s(/* @__PURE__ */ r(o, { message: "Test message", title: "Test Title" }));
22
+ const t = a.getByRole("heading", { level: 2 });
23
+ e(t).toHaveTextContent("Test Title");
24
+ }), n("should render message in div element", () => {
25
+ const { container: t } = s(/* @__PURE__ */ r(o, { message: "Test message", title: "Error" })), c = t.querySelector("div.error-handler__message-text");
26
+ e(c).toBeInTheDocument(), e(c).toHaveTextContent("Test message");
27
+ });
28
+ }), m("CSS Classes", () => {
29
+ n("should apply error-handler__message class to container div", () => {
30
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "Error" }));
31
+ const t = document.querySelector(".error-handler__message");
32
+ e(t).toBeInTheDocument();
33
+ }), n("should apply error-handler__title class to h2", () => {
34
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "Error" }));
35
+ const t = document.querySelector(".error-handler__title");
36
+ e(t).toBeInTheDocument(), e(t == null ? void 0 : t.tagName).toBe("H2");
37
+ }), n("should apply error-handler__message-text class to div", () => {
38
+ s(/* @__PURE__ */ r(o, { message: "Test", title: "Error" }));
39
+ const t = document.querySelector(".error-handler__message-text");
40
+ e(t).toBeInTheDocument(), e(t == null ? void 0 : t.tagName).toBe("DIV");
41
+ });
42
+ }), m("HTML Parsing in Message", () => {
43
+ n("should parse HTML tags in message", () => {
44
+ s(/* @__PURE__ */ r(o, { message: "<strong>Bold text</strong>", title: "Error" }));
45
+ const t = document.querySelector("strong");
46
+ e(t).toBeInTheDocument(), e(t).toHaveTextContent("Bold text");
47
+ }), n("should parse multiple HTML tags", () => {
48
+ s(/* @__PURE__ */ r(o, { message: "<em>Italic</em> and <strong>bold</strong>", title: "Error" })), e(document.querySelector("em")).toBeInTheDocument(), e(document.querySelector("strong")).toBeInTheDocument();
49
+ }), n("should parse links in message", () => {
50
+ s(/* @__PURE__ */ r(o, { message: '<a href="/help">Click here</a> for help', title: "Error" }));
51
+ const t = a.getByRole("link", { name: /click here/i });
52
+ e(t).toBeInTheDocument(), e(t).toHaveAttribute("href", "/help");
53
+ }), n("should parse nested HTML elements", () => {
54
+ s(/* @__PURE__ */ r(o, { message: "<div><span>Nested content</span></div>", title: "Error" }));
55
+ const t = document.querySelector("span");
56
+ e(t).toBeInTheDocument(), e(t).toHaveTextContent("Nested content");
57
+ }), n("should handle plain text without HTML", () => {
58
+ s(/* @__PURE__ */ r(o, { message: "Plain text message", title: "Error" })), e(a.getByText("Plain text message")).toBeInTheDocument();
59
+ }), n("should parse line breaks", () => {
60
+ s(/* @__PURE__ */ r(o, { message: "Line 1<br/>Line 2", title: "Error" }));
61
+ const t = document.querySelector("br");
62
+ e(t).toBeInTheDocument();
63
+ }), n("should handle mixed content", () => {
64
+ s(/* @__PURE__ */ r(o, { message: "Some text <strong>bold</strong> more text", title: "Error" }));
65
+ const t = document.querySelector(".error-handler__message-text");
66
+ e(t).toHaveTextContent("Some text bold more text"), e(t == null ? void 0 : t.querySelector("strong")).toBeInTheDocument();
67
+ });
68
+ }), m("Title Variations", () => {
69
+ n("should render short title", () => {
70
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "Error" })), e(a.getByText("Error")).toBeInTheDocument();
71
+ }), n("should render long title", () => {
72
+ const t = "This is a very long error title that describes the problem in detail";
73
+ s(/* @__PURE__ */ r(o, { message: "Message", title: t })), e(a.getByText(t)).toBeInTheDocument();
74
+ }), n("should render title with special characters", () => {
75
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "Error: 404 - Not Found!" })), e(a.getByText("Error: 404 - Not Found!")).toBeInTheDocument();
76
+ }), n("should render title with numbers", () => {
77
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "Error Code 500" })), e(a.getByText("Error Code 500")).toBeInTheDocument();
78
+ }), n("should handle empty title", () => {
79
+ s(/* @__PURE__ */ r(o, { message: "Message", title: "" }));
80
+ const t = a.getByRole("heading", { level: 2 });
81
+ e(t).toHaveTextContent("");
82
+ });
83
+ }), m("Message Variations", () => {
84
+ n("should render short message", () => {
85
+ s(/* @__PURE__ */ r(o, { message: "Oops!", title: "Error" })), e(a.getByText("Oops!")).toBeInTheDocument();
86
+ }), n("should render long message", () => {
87
+ const t = "This is a very long error message that provides detailed information about what went wrong and how the user might be able to fix it.";
88
+ s(/* @__PURE__ */ r(o, { message: t, title: "Error" })), e(a.getByText(t)).toBeInTheDocument();
89
+ }), n("should render message with special characters", () => {
90
+ s(/* @__PURE__ */ r(o, { message: "Error: Can't process & save data!", title: "Error" })), e(a.getByText(/Error: Can't process & save data!/)).toBeInTheDocument();
91
+ }), n("should render message with quotes", () => {
92
+ s(/* @__PURE__ */ r(o, { message: 'The "file" could not be found', title: "Error" })), e(a.getByText(/The "file" could not be found/)).toBeInTheDocument();
93
+ }), n("should handle empty message", () => {
94
+ s(/* @__PURE__ */ r(o, { message: "", title: "Error" }));
95
+ const t = document.querySelector(".error-handler__message-text");
96
+ e(t).toBeInTheDocument(), e(t).toHaveTextContent("");
97
+ }), n("should render message with multiple paragraphs", () => {
98
+ s(/* @__PURE__ */ r(o, { message: "<p>Paragraph 1</p><p>Paragraph 2</p>", title: "Error" }));
99
+ const t = document.querySelectorAll("p");
100
+ e(t.length).toBeGreaterThanOrEqual(2);
101
+ });
102
+ }), m("Component Structure", () => {
103
+ n("should have correct DOM hierarchy", () => {
104
+ const { container: t } = s(/* @__PURE__ */ r(o, { message: "Message", title: "Error" })), c = t.querySelector("error-handler"), l = c == null ? void 0 : c.querySelector(".error-handler__message"), h = l == null ? void 0 : l.querySelector("h2"), i = l == null ? void 0 : l.querySelector(".error-handler__message-text");
105
+ e(c).toBeInTheDocument(), e(l).toBeInTheDocument(), e(h).toBeInTheDocument(), e(i).toBeInTheDocument();
106
+ }), n("should have h2 before div in DOM order", () => {
107
+ var h, i;
108
+ const { container: t } = s(/* @__PURE__ */ r(o, { message: "Test", title: "Error" })), c = t.querySelector(".error-handler__message"), l = Array.from((c == null ? void 0 : c.children) || []);
109
+ e((h = l[0]) == null ? void 0 : h.tagName).toBe("H2"), e((i = l[1]) == null ? void 0 : i.tagName).toBe("DIV");
110
+ });
111
+ }), m("Edge Cases", () => {
112
+ n("should handle HTML entities in message", () => {
113
+ const t = y.spyOn(console, "error").mockImplementation(() => {
114
+ }), { container: c } = s(/* @__PURE__ */ r(o, { message: '<tag> & "text"', title: "Error" })), l = c.querySelector(".error-handler__message-text");
115
+ e(l).toBeInTheDocument();
116
+ const h = l == null ? void 0 : l.querySelector("tag");
117
+ e(h).toBeInTheDocument(), t.mockRestore();
118
+ }), n("should handle unicode characters", () => {
119
+ s(/* @__PURE__ */ r(o, { message: "Error: © 2024 — Something™ went wrong… 😢", title: "Error" })), e(a.getByText(/Error: © 2024 — Something™ went wrong… 😢/)).toBeInTheDocument();
120
+ }), n("should handle message with only HTML tags", () => {
121
+ s(/* @__PURE__ */ r(o, { message: "<strong></strong>", title: "Error" }));
122
+ const t = document.querySelector("strong");
123
+ e(t).toBeInTheDocument();
124
+ }), n("should handle self-closing tags", () => {
125
+ s(/* @__PURE__ */ r(o, { message: "Line 1<br />Line 2", title: "Error" }));
126
+ const t = document.querySelector("br");
127
+ e(t).toBeInTheDocument();
128
+ }), n("should handle message with scripts (security consideration)", () => {
129
+ s(/* @__PURE__ */ r(o, { message: '<script>alert("test")<\/script>Normal text', title: "Error" })), e(a.getByText(/Normal text/)).toBeInTheDocument();
130
+ });
131
+ }), m("Integration", () => {
132
+ n("should render complete error handler with all features", () => {
133
+ const { container: t } = s(
134
+ /* @__PURE__ */ r(
135
+ o,
136
+ {
137
+ message: 'The page you are looking for could not be found. <a href="/">Go home</a> or <a href="/contact">contact support</a>.',
138
+ title: "Error 404: Page Not Found"
139
+ }
140
+ )
141
+ ), c = t.querySelector("error-handler");
142
+ e(c).toBeInTheDocument(), e(a.getByText("Error 404: Page Not Found")).toBeInTheDocument(), e(a.getByText(/The page you are looking for could not be found/)).toBeInTheDocument();
143
+ const l = a.getAllByRole("link");
144
+ e(l).toHaveLength(2), e(l[0]).toHaveAttribute("href", "/"), e(l[1]).toHaveAttribute("href", "/contact");
145
+ }), n("should render multiple ErrorHandler components independently", () => {
146
+ const { container: t } = s(
147
+ /* @__PURE__ */ d(u, { children: [
148
+ /* @__PURE__ */ r(o, { message: "First error message", title: "Error 1" }),
149
+ /* @__PURE__ */ r(o, { message: "Second error message", title: "Error 2" })
150
+ ] })
151
+ ), c = t.querySelectorAll("error-handler");
152
+ e(c).toHaveLength(2), e(a.getByText("Error 1")).toBeInTheDocument(), e(a.getByText("Error 2")).toBeInTheDocument(), e(a.getByText("First error message")).toBeInTheDocument(), e(a.getByText("Second error message")).toBeInTheDocument();
153
+ }), n("should update when props change", () => {
154
+ const { rerender: t } = s(/* @__PURE__ */ r(o, { message: "Message 1", title: "Error 1" }));
155
+ e(a.getByText("Error 1")).toBeInTheDocument(), e(a.getByText("Message 1")).toBeInTheDocument(), t(/* @__PURE__ */ r(o, { message: "Message 2", title: "Error 2" })), e(a.getByText("Error 2")).toBeInTheDocument(), e(a.getByText("Message 2")).toBeInTheDocument(), e(a.queryByText("Error 1")).not.toBeInTheDocument(), e(a.queryByText("Message 1")).not.toBeInTheDocument();
156
+ });
157
+ });
158
+ });