@scrippsproduct/networks-ui-library 1.1.8 → 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 (121) 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/assets/ScheduleLayout.css +1 -1
  6. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  7. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  8. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  9. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  10. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  11. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  12. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  13. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  14. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  15. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  16. package/dist/components/Button/Button.test.js +434 -0
  17. package/dist/components/Carousel/Carousel.js +2 -2
  18. package/dist/components/Carousel/Carousel.test.js +705 -0
  19. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  20. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  21. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  22. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  23. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  24. package/dist/components/Concat/Concat.js +1 -1
  25. package/dist/components/Concat/Concat.test.js +115 -0
  26. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  27. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  28. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  29. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  30. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  31. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  32. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  33. package/dist/components/DatePicker/DatePicker.js +1 -1
  34. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  35. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  36. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  37. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  38. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  39. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  40. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  41. package/dist/components/Figure/Figure.js +1 -1
  42. package/dist/components/Figure/Figure.test.js +198 -0
  43. package/dist/components/FindUs/FindUs.test.js +499 -0
  44. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  45. package/dist/components/GenericList/GenericList.js +1 -1
  46. package/dist/components/GenericList/GenericList.test.js +288 -0
  47. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  48. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  49. package/dist/components/GradientButton/GradientButton.js +33 -31
  50. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  51. package/dist/components/GridList/GridList.test.js +371 -0
  52. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  53. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  54. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  55. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  56. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  57. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  58. package/dist/components/Input/Input.js +1 -1
  59. package/dist/components/Input/Input.test.js +263 -0
  60. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  61. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  62. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  63. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  64. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  65. package/dist/components/NavList/NavList.test.js +332 -0
  66. package/dist/components/Overlay/Overlay.js +24 -23
  67. package/dist/components/Overlay/Overlay.test.js +198 -0
  68. package/dist/components/PageHero/PageHero.test.js +241 -0
  69. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  71. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  72. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  73. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  74. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  75. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  76. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  77. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  78. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  79. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  80. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  82. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  83. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  84. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  85. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  86. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  88. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  89. package/dist/components/Select/Select.js +24 -24
  90. package/dist/components/Select/Select.test.js +367 -0
  91. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  92. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  93. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  94. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  95. package/dist/components/StringList/StringList.js +1 -1
  96. package/dist/components/StringList/StringList.test.js +311 -0
  97. package/dist/components/TabContent/TabContent.js +1 -1
  98. package/dist/components/TabContent/TabContent.test.js +274 -0
  99. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  100. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  101. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  102. package/dist/components/TextArea/TextArea.js +1 -1
  103. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  104. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  105. package/dist/index-BUN4jQ3m.mjs +3098 -0
  106. package/dist/index-BVxBrkZB.mjs +3 -0
  107. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  108. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  109. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  110. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  111. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  112. package/dist/test/setupTests.d.ts +1 -0
  113. package/dist/test/setupTests.js +55 -0
  114. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  115. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  116. package/dist/utils/analytics.js +1 -1
  117. package/dist/utils/getOnNowProgram.js +10 -10
  118. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  119. package/package.json +4 -1
  120. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  121. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -0,0 +1,226 @@
1
+ import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
+ import { d as i, i as o, r as l, g as e, s as r } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { u as h } from "../../index-BUN4jQ3m.mjs";
4
+ import "../../index-BVxBrkZB.mjs";
5
+ import { CtaBlock as a } from "./CtaBlock.js";
6
+ i("CtaBlock", () => {
7
+ i("Basic Rendering", () => {
8
+ o("should render with minimal props", () => {
9
+ const { container: t } = l(/* @__PURE__ */ n(a, {}));
10
+ e(t.querySelector("cta-block")).toBeInTheDocument();
11
+ }), o("should render title when provided", () => {
12
+ l(/* @__PURE__ */ n(a, { title: "Test Title" })), e(r.getByRole("heading", { level: 1 })).toBeInTheDocument(), e(r.getByText("Test Title")).toBeInTheDocument();
13
+ }), o("should not render title when empty string", () => {
14
+ const { container: t } = l(/* @__PURE__ */ n(a, { title: "" }));
15
+ e(t.querySelector("h1")).not.toBeInTheDocument();
16
+ }), o("should render content as string", () => {
17
+ const t = "This is test content";
18
+ l(/* @__PURE__ */ n(a, { content: t })), e(r.getByText(t)).toBeInTheDocument();
19
+ }), o("should render content as JSX element", () => {
20
+ l(/* @__PURE__ */ n(a, { content: /* @__PURE__ */ n("div", { children: "JSX Content" }) })), e(r.getByText("JSX Content")).toBeInTheDocument();
21
+ }), o("should not render content when empty string", () => {
22
+ const { container: t } = l(/* @__PURE__ */ n(a, { content: "" })), c = t.querySelector(".cta-block__content");
23
+ e(c).not.toBeInTheDocument();
24
+ }), o("should render CTA button", () => {
25
+ l(/* @__PURE__ */ n(a, { cta: { label: "Click Me", href: "/test", type: "internal-link" } })), e(r.getByRole("link", { name: "Click Me" })).toBeInTheDocument();
26
+ });
27
+ }), i("Title Rendering", () => {
28
+ o("should parse HTML in title", () => {
29
+ l(/* @__PURE__ */ n(a, { title: "<strong>Bold</strong> Title" }));
30
+ const t = r.getByText("Bold");
31
+ e(t.tagName).toBe("STRONG");
32
+ }), o("should render title image when titleImageUrl is provided", () => {
33
+ l(/* @__PURE__ */ n(a, { title: "Test Title", titleImageUrl: "/path/to/image.png" }));
34
+ const t = r.getByRole("heading", { level: 1 });
35
+ e(t).toHaveClass("cta-block__title-img");
36
+ }), o("should render sr-only span for accessibility when using title image", () => {
37
+ l(/* @__PURE__ */ n(a, { title: "Accessible Title", titleImageUrl: "/image.png" }));
38
+ const t = r.getByText("Accessible Title");
39
+ e(t).toHaveClass("sr-only");
40
+ }), o("should not have image class when titleImageUrl is not provided", () => {
41
+ l(/* @__PURE__ */ n(a, { title: "Regular Title" }));
42
+ const t = r.getByRole("heading", { level: 1 });
43
+ e(t).not.toHaveClass("cta-block__title-img");
44
+ }), o("should apply CSS variable for title image", () => {
45
+ const { container: t } = l(/* @__PURE__ */ n(a, { titleImageUrl: "/test-image.jpg" })), c = t.querySelector("cta-block");
46
+ e(c).toHaveStyle({ "--title-image": "url(/test-image.jpg)" });
47
+ });
48
+ }), i("Content Rendering", () => {
49
+ o("should parse HTML in content string", () => {
50
+ l(/* @__PURE__ */ n(a, { content: "<em>Italic</em> text" }));
51
+ const t = r.getByText("Italic");
52
+ e(t.tagName).toBe("EM");
53
+ }), o("should render complex HTML content", () => {
54
+ l(/* @__PURE__ */ n(a, { content: "<p>Paragraph <strong>bold</strong></p>" })), e(r.getByText("bold")).toBeInTheDocument();
55
+ }), o("should apply content class", () => {
56
+ const { container: t } = l(/* @__PURE__ */ n(a, { content: "Test content" })), c = t.querySelector(".cta-block__content");
57
+ e(c).toBeInTheDocument();
58
+ });
59
+ }), i("CTA Types", () => {
60
+ o('should use default label "View More" for internal-link type', () => {
61
+ l(/* @__PURE__ */ n(a, { cta: { href: "/page", type: "internal-link" }, type: "internal-link" })), e(r.getByRole("link", { name: "View More" })).toBeInTheDocument();
62
+ }), o('should use default label "Learn More" for external-link type', () => {
63
+ l(/* @__PURE__ */ n(a, { cta: { href: "https://example.com", type: "external-link" }, type: "external-link" })), e(r.getByRole("link", { name: "Learn More" })).toBeInTheDocument();
64
+ }), o('should use default label "View Promo" for play-video type', () => {
65
+ l(/* @__PURE__ */ n(a, { cta: { href: "#", type: "play-video" }, type: "play-video" })), e(r.getByRole("link", { name: "View Promo" })).toBeInTheDocument();
66
+ }), o("should override default label with custom CTA label", () => {
67
+ l(/* @__PURE__ */ n(a, { cta: { label: "Custom Label", href: "/page", type: "internal-link" }, type: "internal-link" })), e(r.getByRole("link", { name: "Custom Label" })).toBeInTheDocument();
68
+ }), o('should set target="_blank" for external-link', () => {
69
+ l(/* @__PURE__ */ n(a, { cta: { href: "https://example.com", type: "external-link" }, type: "external-link" }));
70
+ const c = r.getByRole("link");
71
+ e(c).toHaveAttribute("target", "_blank");
72
+ }), o('should set rel="noreferrer" for external-link', () => {
73
+ l(/* @__PURE__ */ n(a, { cta: { href: "https://example.com", type: "external-link" }, type: "external-link" }));
74
+ const c = r.getByRole("link");
75
+ e(c).toHaveAttribute("rel", "noreferrer");
76
+ }), o('should set target="_self" for internal-link', () => {
77
+ l(/* @__PURE__ */ n(a, { cta: { href: "/page", type: "internal-link" }, type: "internal-link" }));
78
+ const c = r.getByRole("link");
79
+ e(c).toHaveAttribute("target", "_self");
80
+ }), o("should not set rel for internal-link", () => {
81
+ l(/* @__PURE__ */ n(a, { cta: { href: "/page", type: "internal-link" }, type: "internal-link" }));
82
+ const c = r.getByRole("link");
83
+ e(c).not.toHaveAttribute("rel");
84
+ });
85
+ }), i("Button Styles", () => {
86
+ o("should render GradientButton when ctaButtonStyle is gradient", () => {
87
+ const t = { label: "Gradient", href: "/test", type: "internal-link" }, { container: c } = l(
88
+ /* @__PURE__ */ n(
89
+ a,
90
+ {
91
+ btnGradientEndColor: "#0000ff",
92
+ btnGradientStartColor: "#ff0000",
93
+ cta: t,
94
+ ctaButtonStyle: "gradient"
95
+ }
96
+ )
97
+ ), s = c.querySelector(".cta-block__cta");
98
+ e(s).toBeInTheDocument();
99
+ }), o("should render regular Button when ctaButtonStyle is flat", () => {
100
+ l(/* @__PURE__ */ n(a, { btnFlatColors: {
101
+ bgColor: "#ffffff",
102
+ bgHoverColor: "#eeeeee",
103
+ color: "#000000",
104
+ hoverColor: "#333333",
105
+ borderColor: "#cccccc",
106
+ borderHoverColor: "#999999"
107
+ }, cta: { label: "Flat", href: "/test", type: "internal-link" }, ctaButtonStyle: "flat" })), e(r.getByRole("link", { name: "Flat" })).toBeInTheDocument();
108
+ }), o("should default to gradient button style", () => {
109
+ const t = { label: "Default", href: "/test", type: "internal-link" }, { container: c } = l(/* @__PURE__ */ n(a, { cta: t })), s = c.querySelector(".cta-block__cta");
110
+ e(s).toBeInTheDocument();
111
+ }), o("should apply custom gradient colors", () => {
112
+ l(
113
+ /* @__PURE__ */ n(
114
+ a,
115
+ {
116
+ btnGradientEndColor: "#654321",
117
+ btnGradientStartColor: "#123456",
118
+ cta: { label: "Custom Gradient", href: "/test", type: "internal-link" },
119
+ ctaButtonStyle: "gradient"
120
+ }
121
+ )
122
+ ), e(r.getByRole("link")).toBeInTheDocument();
123
+ });
124
+ }), i("Click Handlers", () => {
125
+ o("should call handleClick for play-video type", async () => {
126
+ const t = h.setup();
127
+ l(/* @__PURE__ */ n(a, { cta: { label: "Play Video", href: "#", type: "play-video" }, type: "play-video" }));
128
+ const s = r.getByRole("link", { name: "Play Video" });
129
+ await t.click(s), e(s).toBeInTheDocument();
130
+ }), o("should use default click handler for non-video types", () => {
131
+ l(/* @__PURE__ */ n(a, { cta: { label: "Link", href: "/test", type: "internal-link" }, type: "internal-link" })), e(r.getByRole("link")).toBeInTheDocument();
132
+ });
133
+ }), i("Default Props", () => {
134
+ o("should use default empty title", () => {
135
+ const { container: t } = l(/* @__PURE__ */ n(a, {}));
136
+ e(t.querySelector("h1")).not.toBeInTheDocument();
137
+ }), o("should use default empty titleImageUrl", () => {
138
+ const { container: t } = l(/* @__PURE__ */ n(a, { title: "Test" })), c = t.querySelector("h1");
139
+ e(c).not.toHaveClass("cta-block__title-img");
140
+ }), o("should use default empty content", () => {
141
+ const { container: t } = l(/* @__PURE__ */ n(a, {}));
142
+ e(t.querySelector(".cta-block__content")).not.toBeInTheDocument();
143
+ }), o("should use default internal-link type", () => {
144
+ l(/* @__PURE__ */ n(a, { cta: { href: "/test", type: "" } }));
145
+ const c = r.getByRole("link");
146
+ e(c).toHaveAttribute("target", "_self");
147
+ }), o("should use default CTA object", () => {
148
+ l(/* @__PURE__ */ n(a, {}));
149
+ const t = r.getByRole("button", { name: "View More" });
150
+ e(t).toBeInTheDocument();
151
+ }), o("should use default gradient button style", () => {
152
+ const { container: t } = l(/* @__PURE__ */ n(a, {})), c = t.querySelector(".cta-block__cta");
153
+ e(c).toBeInTheDocument();
154
+ }), o("should use default flat button colors", () => {
155
+ l(/* @__PURE__ */ n(a, { cta: { label: "Test", href: "/test", type: "internal-link" }, ctaButtonStyle: "flat" })), e(r.getByRole("link")).toBeInTheDocument();
156
+ });
157
+ }), i("Complex Scenarios", () => {
158
+ o("should render complete CtaBlock with all props", () => {
159
+ l(
160
+ /* @__PURE__ */ n(
161
+ a,
162
+ {
163
+ btnGradientEndColor: "#0000ff",
164
+ btnGradientStartColor: "#ff0000",
165
+ content: "<p>Rich <em>HTML</em> content</p>",
166
+ cta: {
167
+ label: "Complete CTA",
168
+ href: "https://example.com",
169
+ type: "external-link"
170
+ },
171
+ ctaButtonStyle: "gradient",
172
+ title: "<strong>Complete</strong> Title",
173
+ titleImageUrl: "/title.png",
174
+ type: "external-link"
175
+ }
176
+ )
177
+ ), e(r.getByRole("heading")).toBeInTheDocument(), e(r.getByText("HTML")).toBeInTheDocument(), e(r.getByRole("link", { name: "Complete CTA" })).toBeInTheDocument();
178
+ }), o("should render with title and no content", () => {
179
+ l(/* @__PURE__ */ n(a, { cta: { label: "Read More", href: "/article", type: "internal-link" }, title: "Article Title" })), e(r.getByText("Article Title")).toBeInTheDocument(), e(r.getByRole("link", { name: "Read More" })).toBeInTheDocument();
180
+ }), o("should render with content and no title", () => {
181
+ l(/* @__PURE__ */ n(a, { content: "Some description text", cta: { label: "Continue", href: "/next", type: "internal-link" } })), e(r.getByText("Some description text")).toBeInTheDocument(), e(r.getByRole("link", { name: "Continue" })).toBeInTheDocument();
182
+ }), o("should handle JSX content with complex structure", () => {
183
+ l(/* @__PURE__ */ n(a, { content: /* @__PURE__ */ u("div", { children: [
184
+ /* @__PURE__ */ n("p", { children: "First paragraph" }),
185
+ /* @__PURE__ */ u("ul", { children: [
186
+ /* @__PURE__ */ n("li", { children: "Item 1" }),
187
+ /* @__PURE__ */ n("li", { children: "Item 2" })
188
+ ] })
189
+ ] }), cta: { label: "Learn More", href: "/learn", type: "internal-link" } })), e(r.getByText("First paragraph")).toBeInTheDocument(), e(r.getByText("Item 1")).toBeInTheDocument(), e(r.getByText("Item 2")).toBeInTheDocument();
190
+ });
191
+ }), i("Wrapper Structure", () => {
192
+ o("should render cta-wrapper element", () => {
193
+ const { container: t } = l(/* @__PURE__ */ n(a, {})), c = t.querySelector("cta-wrapper");
194
+ e(c).toBeInTheDocument();
195
+ }), o("should have CTA button inside wrapper", () => {
196
+ const { container: t } = l(/* @__PURE__ */ n(a, {})), c = t.querySelector("cta-wrapper"), s = c == null ? void 0 : c.querySelector(".cta-block__cta");
197
+ e(s).toBeInTheDocument();
198
+ });
199
+ }), i("CSS Classes", () => {
200
+ o("should apply h2 class to title", () => {
201
+ l(/* @__PURE__ */ n(a, { title: "Test" }));
202
+ const t = r.getByRole("heading");
203
+ e(t).toHaveClass("h2");
204
+ }), o("should apply cta-block__cta class to button", () => {
205
+ const { container: t } = l(/* @__PURE__ */ n(a, {})), c = t.querySelector(".cta-block__cta");
206
+ e(c).toBeInTheDocument();
207
+ }), o("should have both module and global classes on CTA", () => {
208
+ const { container: t } = l(/* @__PURE__ */ n(a, {})), c = t.querySelector(".cta-block__cta");
209
+ e(c).toHaveClass("cta-block__cta");
210
+ });
211
+ }), i("Href Handling", () => {
212
+ o("should set href attribute on CTA link", () => {
213
+ l(/* @__PURE__ */ n(a, { cta: { label: "Test", href: "/test-page", type: "internal-link" } }));
214
+ const c = r.getByRole("link");
215
+ e(c).toHaveAttribute("href", "/test-page");
216
+ }), o("should handle external URLs", () => {
217
+ l(/* @__PURE__ */ n(a, { cta: { label: "External", href: "https://external.com", type: "external-link" } }));
218
+ const c = r.getByRole("link");
219
+ e(c).toHaveAttribute("href", "https://external.com");
220
+ }), o("should handle empty href", () => {
221
+ l(/* @__PURE__ */ n(a, { cta: { label: "Empty", href: "", type: "internal-link" } }));
222
+ const c = r.getByRole("button", { name: "Empty" });
223
+ e(c).toBeInTheDocument();
224
+ });
225
+ });
226
+ });
@@ -2,10 +2,10 @@ import { jsxs as p, jsx as l } from "react/jsx-runtime";
2
2
  import z, { forwardRef as ne, useState as y, useRef as T, useCallback as ue, useEffect as de } from "react";
3
3
  import { classes as w } from "../../utils/helpers.js";
4
4
  import { CreateChoiceList as _e } from "../CreateChoiceList/CreateChoiceList.js";
5
- import { s as g, C as he, A as fe } from "../../Form.module-Cd8qH2rj.mjs";
6
- import { X as me } from "../../x-C-QzJ-qD.mjs";
7
- import { P as L } from "../../index-DC2JJV3a.mjs";
8
- import { T as pe } from "../../triangle-PcCcGXjr.mjs";
5
+ import { s as g, C as he, A as fe } from "../../Form.module-CarfWK5T.mjs";
6
+ import { X as me } from "../../x-Ck9Vk5Fo.mjs";
7
+ import { P as L } from "../../index-D3kkcgee.mjs";
8
+ import { T as pe } from "../../triangle-C4z906Wf.mjs";
9
9
  import '../../assets/CustomDataList.css';function M() {
10
10
  return M = Object.assign || function(i) {
11
11
  for (var a = 1; a < arguments.length; a++) {
@@ -1,81 +1,81 @@
1
1
  import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
- import X, { forwardRef as ne, useState as C, useRef as I } from "react";
3
- import { publish as G } from "../../utils/events.js";
2
+ import G, { forwardRef as ie, useState as C, useRef as I } from "react";
3
+ import { publish as J } from "../../utils/events.js";
4
4
  import { classes as m } from "../../utils/helpers.js";
5
- import { s as a, C as ie } from "../../ChoicesItem-CT9fXB0I.mjs";
6
- import { s as v, C as oe, A as ae } from "../../Form.module-Cd8qH2rj.mjs";
7
- import { X as ue } from "../../x-C-QzJ-qD.mjs";
8
- import { T as de } from "../../triangle-PcCcGXjr.mjs";
9
- import { P as x } from "../../index-DC2JJV3a.mjs";
5
+ import { s as u, C as oe } from "../../ChoicesItem-CT9fXB0I.mjs";
6
+ import { s as v, C as ae, A as ue } from "../../Form.module-CarfWK5T.mjs";
7
+ import { X as de } from "../../x-Ck9Vk5Fo.mjs";
8
+ import { T as fe } from "../../triangle-C4z906Wf.mjs";
9
+ import { P as x } from "../../index-D3kkcgee.mjs";
10
10
  function R() {
11
11
  return R = Object.assign || function(t) {
12
- for (var u = 1; u < arguments.length; u++) {
13
- var l = arguments[u];
14
- for (var n in l)
15
- Object.prototype.hasOwnProperty.call(l, n) && (t[n] = l[n]);
12
+ for (var l = 1; l < arguments.length; l++) {
13
+ var n = arguments[l];
14
+ for (var i in n)
15
+ Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
16
16
  }
17
17
  return t;
18
18
  }, R.apply(this, arguments);
19
19
  }
20
- function fe(t, u) {
20
+ function he(t, l) {
21
21
  if (t == null) return {};
22
- var l = he(t, u), n, c;
22
+ var n = me(t, l), i, c;
23
23
  if (Object.getOwnPropertySymbols) {
24
- var i = Object.getOwnPropertySymbols(t);
25
- for (c = 0; c < i.length; c++)
26
- n = i[c], !(u.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (l[n] = t[n]);
24
+ var o = Object.getOwnPropertySymbols(t);
25
+ for (c = 0; c < o.length; c++)
26
+ i = o[c], !(l.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(t, i) && (n[i] = t[i]);
27
27
  }
28
- return l;
28
+ return n;
29
29
  }
30
- function he(t, u) {
30
+ function me(t, l) {
31
31
  if (t == null) return {};
32
- var l = {}, n = Object.keys(t), c, i;
33
- for (i = 0; i < n.length; i++)
34
- c = n[i], !(u.indexOf(c) >= 0) && (l[c] = t[c]);
35
- return l;
32
+ var n = {}, i = Object.keys(t), c, o;
33
+ for (o = 0; o < i.length; o++)
34
+ c = i[o], !(l.indexOf(c) >= 0) && (n[c] = t[c]);
35
+ return n;
36
36
  }
37
- var L = ne(function(t, u) {
38
- var l = t.color, n = l === void 0 ? "currentColor" : l, c = t.size, i = c === void 0 ? 24 : c, T = fe(t, ["color", "size"]);
39
- return /* @__PURE__ */ X.createElement("svg", R({
40
- ref: u,
37
+ var V = ie(function(t, l) {
38
+ var n = t.color, i = n === void 0 ? "currentColor" : n, c = t.size, o = c === void 0 ? 24 : c, T = he(t, ["color", "size"]);
39
+ return /* @__PURE__ */ G.createElement("svg", R({
40
+ ref: l,
41
41
  xmlns: "http://www.w3.org/2000/svg",
42
- width: i,
43
- height: i,
42
+ width: o,
43
+ height: o,
44
44
  viewBox: "0 0 24 24",
45
45
  fill: "none",
46
- stroke: n,
46
+ stroke: i,
47
47
  strokeWidth: "2",
48
48
  strokeLinecap: "round",
49
49
  strokeLinejoin: "round"
50
- }, T), /* @__PURE__ */ X.createElement("polyline", {
50
+ }, T), /* @__PURE__ */ G.createElement("polyline", {
51
51
  points: "6 9 12 15 18 9"
52
52
  }));
53
53
  });
54
- L.propTypes = {
54
+ V.propTypes = {
55
55
  color: x.string,
56
56
  size: x.oneOfType([x.string, x.number])
57
57
  };
58
- L.displayName = "ChevronDown";
59
- function ke({
58
+ V.displayName = "ChevronDown";
59
+ function Se({
60
60
  name: t,
61
- options: u,
62
- label: l = "",
63
- width: n = 100,
61
+ options: l,
62
+ label: n = "",
63
+ width: i = 100,
64
64
  multiple: c = !1,
65
- placeholder: i = "",
66
- ValidIcon: T = oe,
67
- InvalidIcon: J = ae,
68
- expandIconType: V = "default",
65
+ placeholder: o = "",
66
+ ValidIcon: T = ae,
67
+ InvalidIcon: Q = ue,
68
+ expandIconType: L = "default",
69
69
  // default, chevron
70
70
  showValidation: E = !0,
71
- ...Q
71
+ ...Y
72
72
  }) {
73
- var U, B, F;
74
- const [Y, Z] = C(`${v["form-field__input"]}`), p = I(null), $ = I(null), [q, K] = C(""), [D, ee] = C("clean"), [N, M] = C([]), [h, O] = C(u.map((e, d) => ({
73
+ var U, B, F, X;
74
+ const [Z, ee] = C(`${v["form-field__input"]}`), p = I(null), $ = I(null), [q, K] = C(""), [D, te] = C("clean"), [N, M] = C([]), [h, O] = C(l.map((e, d) => ({
75
75
  ...e,
76
76
  id: e != null && e.id ? e == null ? void 0 : e.id : `${t}-${d + 1}`,
77
77
  status: "active"
78
- }))), [A, te] = C(null), [g, W] = C("hidden"), o = I(-1), se = `input-width--${n}`, z = (e, d, f = "selected") => {
78
+ }))), [A, se] = C(null), [g, W] = C("hidden"), a = I(-1), ce = `input-width--${i}`, z = (e, d, f = "selected") => {
79
79
  if (!c && f === "selected" || f === "highlighted") {
80
80
  for (const s of e)
81
81
  if (s.status === f) {
@@ -85,17 +85,17 @@ function ke({
85
85
  }
86
86
  for (const s of e)
87
87
  if (s.id === d && (c && s.status !== "selected" && f === "selected" && M([...N, s]), s.status !== "selected" && (s.status = f), f === "selected")) {
88
- te(s);
88
+ se(s);
89
89
  break;
90
90
  }
91
91
  return e;
92
- }, ce = () => {
92
+ }, re = () => {
93
93
  setTimeout(() => {
94
94
  p.current && p.current.checkValidity() ? K("") : p.current && K(p.current.validationMessage);
95
95
  }, 100);
96
96
  }, k = (e) => {
97
- e == null || e.stopPropagation(), ee("touched"), Z(`${v["form-field__input"]} ${v["input--touched"]}`), g === "hidden" ? W("visible") : (W("hidden"), ce());
98
- }, re = (e) => {
97
+ e == null || e.stopPropagation(), te("touched"), ee(`${v["form-field__input"]} ${v["input--touched"]}`), g === "hidden" ? W("visible") : (W("hidden"), re());
98
+ }, le = (e) => {
99
99
  const f = N.filter((y) => y.id !== e);
100
100
  M([...f]);
101
101
  let s = h;
@@ -112,13 +112,13 @@ function ke({
112
112
  O([...b]);
113
113
  const S = document.querySelector(`select[name="${t}"] > option[value="${e}"]`);
114
114
  S && (S.selected = !1);
115
- }, le = (e) => {
115
+ }, ne = (e) => {
116
116
  const d = structuredClone(h), f = z(d, e);
117
- O([...f]), k(null), o.current = -1;
117
+ O([...f]), k(null), a.current = -1;
118
118
  const s = h.find((b) => b.id === e);
119
119
  if (!s) return;
120
120
  const _ = document.querySelector(`select[name="${t}"] > option[value="${s.value}"]`);
121
- _ && (_.selected = !0), G("scripps:customselect:selected", { value: s.value });
121
+ _ && (_.selected = !0), J("scripps:customselect:selected", { value: s.value });
122
122
  }, H = (e) => {
123
123
  if (e.key === "Tab" || (e.key === "ArrowDown" || e.key === "ArrowUp") && g !== "visible") return !0;
124
124
  e.stopPropagation(), e.preventDefault();
@@ -127,31 +127,31 @@ function ke({
127
127
  O([...b]);
128
128
  };
129
129
  if (d === "ArrowDown" && g === "visible")
130
- o.current < h.length - 1 ? (s(o.current + 1), o.current++) : (s(0), o.current = 0);
130
+ a.current < h.length - 1 ? (s(a.current + 1), a.current++) : (s(0), a.current = 0);
131
131
  else if (d === "ArrowUp" && g === "visible")
132
- o.current > 0 ? (s(o.current - 1), o.current--) : (s(h.length - 1), o.current = h.length - 1);
132
+ a.current > 0 ? (s(a.current - 1), a.current--) : (s(h.length - 1), a.current = h.length - 1);
133
133
  else if (d === "Enter")
134
- if (g === "visible" && o.current !== -1) {
135
- const _ = h[o.current].id, b = z(f, _);
136
- O([...b]), k(null), o.current = -1;
134
+ if (g === "visible" && a.current !== -1) {
135
+ const _ = h[a.current].id, b = z(f, _);
136
+ O([...b]), k(null), a.current = -1;
137
137
  const S = h.find((j) => j.id === _);
138
138
  if (!S) return;
139
139
  const y = document.querySelector(`select[name="${t}"] > option[value="${S.value}"]`);
140
- y && (y.selected = !0), G("scripps:customselect:selected", { value: S.value });
140
+ y && (y.selected = !0), J("scripps:customselect:selected", { value: S.value });
141
141
  } else
142
142
  k(null);
143
143
  else if (d === "Escape" && g === "visible")
144
- k(null), o.current = -1;
144
+ k(null), a.current = -1;
145
145
  else
146
146
  return !1;
147
- 30 * o.current > 160 && $.current ? $.current.scrollTo(0, 30 * o.current) : $.current && $.current.scrollTo(0, 0);
147
+ 30 * a.current > 160 && $.current ? $.current.scrollTo(0, 30 * a.current) : $.current && $.current.scrollTo(0, 0);
148
148
  };
149
149
  return /* @__PURE__ */ w(
150
150
  "label",
151
151
  {
152
152
  className: m([
153
153
  v["form-field"],
154
- v[se]
154
+ v[ce]
155
155
  ]),
156
156
  htmlFor: t,
157
157
  children: [
@@ -162,32 +162,32 @@ function ke({
162
162
  v["form-field__icon"],
163
163
  (U = p.current) != null && U.validity.valid ? "" : v["form-field__icon--invalid"]
164
164
  ].join(" "),
165
- style: l === "" ? { top: "0.4em" } : {},
165
+ style: n === "" ? { top: "0.4em" } : {},
166
166
  children: [
167
167
  ((B = p.current) == null ? void 0 : B.checkValidity()) && D === "touched" && /* @__PURE__ */ r(T, {}),
168
- !((F = p.current) != null && F.checkValidity()) && D === "touched" && /* @__PURE__ */ r(J, {})
168
+ !((F = p.current) != null && F.checkValidity()) && D === "touched" && /* @__PURE__ */ r(Q, {})
169
169
  ]
170
170
  }
171
171
  ),
172
- l !== "" && /* @__PURE__ */ r("span", { className: v["form-field__label"], children: l }),
172
+ n !== "" && /* @__PURE__ */ r("span", { className: v["form-field__label"], children: n }),
173
173
  /* @__PURE__ */ w(
174
174
  "select",
175
175
  {
176
176
  className: m([
177
- a["custom-select__select"],
178
- D === "touched" && E ? a["custom-select__select--touched"] : ""
177
+ u["custom-select__select"],
178
+ D === "touched" && E ? u["custom-select__select--touched"] : ""
179
179
  ]),
180
+ defaultValue: c ? l.filter((e) => e.selected).map((e) => e.value).filter((e) => e !== void 0) : ((X = l.find((e) => e.selected)) == null ? void 0 : X.value) || "",
180
181
  multiple: c,
181
182
  name: t,
182
183
  ref: p,
183
184
  tabIndex: -1,
184
- ...Q,
185
+ ...Y,
185
186
  children: [
186
187
  /* @__PURE__ */ r("option", { value: "" }),
187
- u.length && u.map((e) => /* @__PURE__ */ r(
188
+ l.length && l.map((e) => /* @__PURE__ */ r(
188
189
  "option",
189
190
  {
190
- selected: e.selected,
191
191
  value: e.value,
192
192
  children: e.label
193
193
  },
@@ -199,49 +199,49 @@ function ke({
199
199
  /* @__PURE__ */ w(
200
200
  "div",
201
201
  {
202
- className: m([Y, a["custom-select"], "custom-select"]),
202
+ className: m([Z, u["custom-select"], "custom-select"]),
203
203
  tabIndex: 0,
204
204
  onKeyDown: H,
205
205
  children: [
206
206
  c && /* @__PURE__ */ w(
207
207
  "ul",
208
208
  {
209
- className: m([a["custom-select__selections"], "custom-select__selections"]),
209
+ className: m([u["custom-select__selections"], "custom-select__selections"]),
210
210
  onClick: k,
211
211
  children: [
212
212
  N.length !== 0 && N.map((e) => /* @__PURE__ */ w(
213
213
  "li",
214
214
  {
215
- className: m([a["custom-select__selected"], "custom-select__selected"]),
215
+ className: m([u["custom-select__selected"], "custom-select__selected"]),
216
216
  children: [
217
217
  e.label,
218
218
  /* @__PURE__ */ r(
219
219
  "button",
220
220
  {
221
- className: a["custom-select__remove"],
221
+ className: u["custom-select__remove"],
222
222
  title: "remove",
223
223
  type: "button",
224
224
  onClick: (d) => {
225
- d.stopPropagation(), re(e.id);
225
+ d.stopPropagation(), le(e.id);
226
226
  },
227
- children: /* @__PURE__ */ r(ue, { height: 16, width: 16 })
227
+ children: /* @__PURE__ */ r(de, { height: 16, width: 16 })
228
228
  }
229
229
  )
230
230
  ]
231
231
  }
232
232
  )),
233
- N.length === 0 && i !== "" && /* @__PURE__ */ r("li", { className: m([a["custom-select__placeholder"], "custom-select__placeholder"]), children: i })
233
+ N.length === 0 && o !== "" && /* @__PURE__ */ r("li", { className: m([u["custom-select__placeholder"], "custom-select__placeholder"]), children: o })
234
234
  ]
235
235
  }
236
236
  ),
237
237
  !c && /* @__PURE__ */ w(
238
238
  "div",
239
239
  {
240
- className: `${a["custom-select__selection"]}`,
240
+ className: `${u["custom-select__selection"]}`,
241
241
  onClick: k,
242
242
  children: [
243
243
  A && A.label,
244
- !A && i !== "" && /* @__PURE__ */ r("span", { className: m([a["custom-select__placeholder"], "custom-select__placeholder"]), children: i })
244
+ !A && o !== "" && /* @__PURE__ */ r("span", { className: m([u["custom-select__placeholder"], "custom-select__placeholder"]), children: o })
245
245
  ]
246
246
  }
247
247
  ),
@@ -249,20 +249,20 @@ function ke({
249
249
  "div",
250
250
  {
251
251
  className: m([
252
- a["custom-select__choices-wrapper"],
252
+ u["custom-select__choices-wrapper"],
253
253
  "custom-select__choices-wrapper",
254
- g === "visible" ? "" : a["custom-select__choices-wrapper--hidden"]
254
+ g === "visible" ? "" : u["custom-select__choices-wrapper--hidden"]
255
255
  ]),
256
256
  children: /* @__PURE__ */ r(
257
257
  "div",
258
258
  {
259
- className: m([a["custom-select__choices"], "custom-select__choices"]),
259
+ className: m([u["custom-select__choices"], "custom-select__choices"]),
260
260
  ref: $,
261
261
  onKeyDown: H,
262
262
  children: /* @__PURE__ */ r("ul", { children: h.length !== 0 && h.map((e) => /* @__PURE__ */ r(
263
- ie,
263
+ oe,
264
264
  {
265
- handleOnClick: le,
265
+ handleOnClick: ne,
266
266
  item: e
267
267
  },
268
268
  `choice-${e.id}`
@@ -271,8 +271,8 @@ function ke({
271
271
  )
272
272
  }
273
273
  ),
274
- V === "default" && /* @__PURE__ */ r("i", { className: a["custom-select__icon"], children: /* @__PURE__ */ r(de, {}) }),
275
- V === "chevron" && /* @__PURE__ */ r("i", { className: m([a["custom-select__icon"], a["custom-select__icon--chevron"], "custom-select__icon--chevron"]), children: /* @__PURE__ */ r(L, {}) })
274
+ L === "default" && /* @__PURE__ */ r("i", { className: u["custom-select__icon"], children: /* @__PURE__ */ r(fe, {}) }),
275
+ L === "chevron" && /* @__PURE__ */ r("i", { className: m([u["custom-select__icon"], u["custom-select__icon--chevron"], "custom-select__icon--chevron"]), children: /* @__PURE__ */ r(V, {}) })
276
276
  ]
277
277
  }
278
278
  ),
@@ -282,6 +282,6 @@ function ke({
282
282
  );
283
283
  }
284
284
  export {
285
- ke as CustomSelect,
286
- ke as default
285
+ Se as CustomSelect,
286
+ Se as default
287
287
  };