@windstream/react-shared-components 0.1.75 → 0.1.76

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.
@@ -40,6 +40,9 @@ export const Navigation: React.FC<NavigationProps> = props => {
40
40
  displaySearchBar = true,
41
41
  displayCallNowCta = true,
42
42
  showCallButton = true,
43
+ showCallNowCtaInMainNav = false,
44
+ showMobileSliderMenu = true,
45
+ callNowCtaIcon,
43
46
  navigationBackgroundColor,
44
47
  navigationLinkColor,
45
48
  } = props;
@@ -61,6 +64,43 @@ export const Navigation: React.FC<NavigationProps> = props => {
61
64
  : `bg-secondary-${navigationBackgroundColor}`
62
65
  : "bg-secondary-navy500";
63
66
 
67
+ const callNowCtaIconUrl =
68
+ typeof callNowCtaIcon === "string"
69
+ ? callNowCtaIcon
70
+ : callNowCtaIcon?.url || "";
71
+
72
+ // Styled "Call Now" pill used in the main nav rows when CMS opts in via
73
+ // `showCallNowCtaInMainNav` (desktop) or when the mobile slider menu is
74
+ // disabled (`showMobileSliderMenu: false`). Mirrors the legacy
75
+ // ResidentialNavbar styling so existing CMS entries render identically.
76
+ const renderMainNavCallCta = (
77
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void
78
+ ) => (
79
+ <Link
80
+ href={invocaPhoneNumberLink || "#"}
81
+ onClick={onClick}
82
+ className="bg-secondary-gray100 text-secondary-navy500 inline-flex h-8 items-center rounded-full pl-1 pr-2 no-underline shadow-none"
83
+ aria-label={
84
+ invocaPhoneNumberDisplayText
85
+ ? `Call ${invocaPhoneNumberDisplayText}`
86
+ : "Call now"
87
+ }
88
+ >
89
+ {callNowCtaIconUrl ? (
90
+ <NextImage
91
+ src={callNowCtaIconUrl}
92
+ alt="Call us"
93
+ width={24}
94
+ height={24}
95
+ className="mr-2 self-center rounded-full"
96
+ />
97
+ ) : null}
98
+ <Text as="span" className="text-secondary-navy500 footnote">
99
+ {invocaPhoneNumberDisplayText}
100
+ </Text>
101
+ </Link>
102
+ );
103
+
64
104
  const hasMobileMenuItems =
65
105
  (primaryNavigationLinks?.length ?? 0) > 0 ||
66
106
  (supportNavigationLinks?.length ?? 0) > 0 ||
@@ -133,7 +173,11 @@ export const Navigation: React.FC<NavigationProps> = props => {
133
173
  </div>
134
174
  ) : null}
135
175
  <div
136
- className={cx("main-nav-container", mainNavBgClass, navigationLinkColor)}
176
+ className={cx(
177
+ "main-nav-container",
178
+ mainNavBgClass,
179
+ navigationLinkColor
180
+ )}
137
181
  aria-label="Main Navigation"
138
182
  >
139
183
  <div className="mobile-nav-section flex h-14 items-center justify-between border border-b px-5 py-[10px] lg:hidden">
@@ -150,30 +194,38 @@ export const Navigation: React.FC<NavigationProps> = props => {
150
194
  ) : null}
151
195
  </div>
152
196
  <div className="flex items-center gap-6">
153
- {showCallButton && !hideMobileCallButton ? (
154
- <CallButton
155
- href={invocaPhoneNumberLink}
156
- onClick={onCallClickMobile}
157
- >
158
- <Text as="span" className="footnote">
159
- {invocaPhoneNumberDisplayText}
160
- </Text>
161
- </CallButton>
162
- ) : null}
163
- {displayCartIcon ? (
164
- <Link
165
- href={cartHref || "#"}
166
- className="relative inline-flex cursor-pointer"
167
- aria-label={cartIconAriaLabel}
168
- onClick={onCartClick}
169
- >
170
- <MaterialIcon name="shopping_cart" />
171
- {cartHasRetention ? (
172
- <span className="absolute -right-2 -top-1 h-2.5 w-2.5 rounded-full bg-icon-brand" />
197
+ {!showMobileSliderMenu ? (
198
+ showCallButton ? (
199
+ renderMainNavCallCta(onCallClickMobile)
200
+ ) : null
201
+ ) : (
202
+ <>
203
+ {showCallButton && !hideMobileCallButton ? (
204
+ <CallButton
205
+ href={invocaPhoneNumberLink}
206
+ onClick={onCallClickMobile}
207
+ >
208
+ <Text as="span" className="footnote">
209
+ {invocaPhoneNumberDisplayText}
210
+ </Text>
211
+ </CallButton>
173
212
  ) : null}
174
- </Link>
175
- ) : null}
176
- {hasMobileMenuItems ? <MobileMenu {...props} /> : null}
213
+ {displayCartIcon ? (
214
+ <Link
215
+ href={cartHref || "#"}
216
+ className="relative inline-flex cursor-pointer"
217
+ aria-label={cartIconAriaLabel}
218
+ onClick={onCartClick}
219
+ >
220
+ <MaterialIcon name="shopping_cart" />
221
+ {cartHasRetention ? (
222
+ <span className="absolute -right-2 -top-1 h-2.5 w-2.5 rounded-full bg-icon-brand" />
223
+ ) : null}
224
+ </Link>
225
+ ) : null}
226
+ {hasMobileMenuItems ? <MobileMenu {...props} /> : null}
227
+ </>
228
+ )}
177
229
  </div>
178
230
  </div>
179
231
 
@@ -206,6 +258,9 @@ export const Navigation: React.FC<NavigationProps> = props => {
206
258
  </div>
207
259
  </div>
208
260
  <div className="flex h-full items-center gap-10">
261
+ {showCallNowCtaInMainNav
262
+ ? renderMainNavCallCta(onCallClickDesktop)
263
+ : null}
209
264
  {displaySearchBar ? (
210
265
  <DesktopSearchInput
211
266
  searchBarIconURL={