@windstream/react-shared-components 0.2.38 → 0.2.41
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.
- package/dist/contentful/index.d.ts +1 -2
- package/dist/contentful/index.esm.js +2 -2
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +2 -2
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/brand-button/index.tsx +4 -4
- package/src/contentful/blocks/button/Button.stories.tsx +0 -1
- package/src/contentful/blocks/button/index.test.tsx +109 -8
- package/src/contentful/blocks/button/index.tsx +64 -18
- package/src/contentful/blocks/button/types.ts +1 -1
- package/src/contentful/blocks/cards/blog-card/index.test.tsx +18 -42
- package/src/contentful/blocks/cards/blog-card/index.tsx +45 -63
- package/src/contentful/blocks/cards/blog-card/types.ts +0 -1
- package/src/contentful/blocks/cards/floating-image-card/index.test.tsx +69 -2
- package/src/contentful/blocks/cards/floating-image-card/index.tsx +7 -4
- package/src/contentful/blocks/carousel/helper.test.tsx +33 -10
- package/src/contentful/blocks/carousel/index.test.tsx +6 -8
- package/src/contentful/blocks/carousel/types.test.ts +10 -0
- package/src/contentful/blocks/cta-callout/CtaCallout.stories.tsx +0 -1
- package/src/contentful/blocks/dynamic-tabs/ordered-tab-views.tsx +1 -1
- package/src/contentful/blocks/ordered-list/index.tsx +2 -2
- package/src/contentful/blocks/primary-hero/index.tsx +6 -2
- package/src/hooks/use-carousel-swipe.test.ts +26 -6
- package/src/types/micro-components.ts +2 -2
|
@@ -10,6 +10,16 @@ describe("carousel types exports", () => {
|
|
|
10
10
|
expect(backgroundColorMap.white).toBe("bg-white");
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
+
it("exports backgroundColorMap with only the supported color keys", () => {
|
|
14
|
+
expect(Object.keys(backgroundColorMap)).toEqual([
|
|
15
|
+
"blue",
|
|
16
|
+
"green",
|
|
17
|
+
"orange",
|
|
18
|
+
"purple",
|
|
19
|
+
"white",
|
|
20
|
+
]);
|
|
21
|
+
});
|
|
22
|
+
|
|
13
23
|
it("exports DEFAULT_TABS", () => {
|
|
14
24
|
expect(DEFAULT_TABS).toEqual(["Business Ready", "Internet Only"]);
|
|
15
25
|
});
|
|
@@ -175,7 +175,7 @@ export function OrderedSidebarView({
|
|
|
175
175
|
return (
|
|
176
176
|
<div className="flex gap-10 px-5 py-20">
|
|
177
177
|
<div className="flex-shrink-0">
|
|
178
|
-
<div className="flex min-w-[320px] gap-4 rounded-[20px] border-2
|
|
178
|
+
<div className="flex min-w-[320px] gap-4 rounded-[20px] border-2 px-6 py-7 shadow-lg">
|
|
179
179
|
{[...new Array(Math.min(2, items.length))].map((_, colIdx) => {
|
|
180
180
|
const perColumn = Math.ceil(items.length / 2);
|
|
181
181
|
|
|
@@ -30,7 +30,7 @@ export const OrderedList = ({
|
|
|
30
30
|
return (
|
|
31
31
|
<Text
|
|
32
32
|
key={`ordered-item-${index}`}
|
|
33
|
-
className="
|
|
33
|
+
className="body1 relative text-left leading-7"
|
|
34
34
|
>
|
|
35
35
|
{formatItemName(item.itemName)}
|
|
36
36
|
</Text>
|
|
@@ -44,7 +44,7 @@ export const OrderedList = ({
|
|
|
44
44
|
title={item.itemName.toUpperCase()}
|
|
45
45
|
className="flex items-center underline underline-offset-4"
|
|
46
46
|
>
|
|
47
|
-
<Text className="
|
|
47
|
+
<Text className="body1 relative cursor-pointer text-left leading-7">
|
|
48
48
|
{formatItemName(item.itemName)}
|
|
49
49
|
</Text>
|
|
50
50
|
</Link>
|
|
@@ -53,7 +53,11 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
53
53
|
const hasDesktopVideo = !!desktopVideoUrl;
|
|
54
54
|
const hasMobileVideo = !!mobileVideoUrl;
|
|
55
55
|
const bottomLinkLabel = bottomLink?.buttonLabel ?? bottomLink?.label;
|
|
56
|
-
const
|
|
56
|
+
const baseTextColorClass = textColor === "dark" ? "text-text" : "text-white";
|
|
57
|
+
const textColorClass =
|
|
58
|
+
hasDesktopVideo && textColor === "dark"
|
|
59
|
+
? `${baseTextColorClass} xl:text-white`
|
|
60
|
+
: baseTextColorClass;
|
|
57
61
|
return (
|
|
58
62
|
<div className="component-container relative overflow-hidden p-4 sm:px-6 sm:py-12 xl:flex xl:min-h-[724px] xl:items-center xl:px-10">
|
|
59
63
|
{hasDesktopVideo ? (
|
|
@@ -324,7 +328,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
324
328
|
) : null}
|
|
325
329
|
|
|
326
330
|
{bottomLink && (bottomLinkLabel || bottomLink?.href) && (
|
|
327
|
-
<div className="lg:hidden">
|
|
331
|
+
<div className="flex lg:hidden">
|
|
328
332
|
<Button
|
|
329
333
|
{...bottomLink}
|
|
330
334
|
onModalButtonClick={onModalButtonClick}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TextDecoder, TextEncoder } from "util";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { CarouselSwipeConfig, useCarouselSwipe } from "./use-carousel-swipe";
|
|
3
4
|
|
|
@@ -368,6 +369,28 @@ describe("useCarouselSwipe", () => {
|
|
|
368
369
|
expect(result.current.containerWidth).toBe(800);
|
|
369
370
|
});
|
|
370
371
|
|
|
372
|
+
it("uses the attached containerRef width when present", () => {
|
|
373
|
+
Object.defineProperty(window, "innerWidth", {
|
|
374
|
+
writable: true,
|
|
375
|
+
value: 1024,
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
const { result } = renderHook(() => useCarouselSwipe(defaultConfig));
|
|
379
|
+
const container = document.createElement("div");
|
|
380
|
+
|
|
381
|
+
Object.defineProperty(container, "offsetWidth", {
|
|
382
|
+
configurable: true,
|
|
383
|
+
value: 640,
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
act(() => {
|
|
387
|
+
result.current.containerRef.current = container as HTMLDivElement;
|
|
388
|
+
window.dispatchEvent(new Event("resize"));
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
expect(result.current.containerWidth).toBe(640);
|
|
392
|
+
});
|
|
393
|
+
|
|
371
394
|
it("uses custom mobileBreakpoint", () => {
|
|
372
395
|
Object.defineProperty(window, "innerWidth", {
|
|
373
396
|
writable: true,
|
|
@@ -392,13 +415,10 @@ describe("useCarouselSwipe", () => {
|
|
|
392
415
|
});
|
|
393
416
|
|
|
394
417
|
describe("SSR safety (window undefined)", () => {
|
|
395
|
-
it("can be created without throwing when window is undefined and uses fallback containerWidth", () => {
|
|
418
|
+
it("can be created without throwing when window is undefined and uses fallback containerWidth", async () => {
|
|
396
419
|
const origWindow = globalThis.window;
|
|
397
420
|
// @ts-expect-error - intentionally deleting window to simulate SSR
|
|
398
421
|
delete globalThis.window;
|
|
399
|
-
|
|
400
|
-
// Polyfill TextEncoder/TextDecoder required by react-dom/server in jest
|
|
401
|
-
const { TextEncoder, TextDecoder } = require("util");
|
|
402
422
|
const origTE = globalThis.TextEncoder;
|
|
403
423
|
const origTD = globalThis.TextDecoder;
|
|
404
424
|
globalThis.TextEncoder = TextEncoder;
|
|
@@ -412,8 +432,8 @@ describe("useCarouselSwipe", () => {
|
|
|
412
432
|
}
|
|
413
433
|
|
|
414
434
|
try {
|
|
415
|
-
|
|
416
|
-
|
|
435
|
+
const { renderToString } = await import("react-dom/server");
|
|
436
|
+
|
|
417
437
|
// renderToString simulates real SSR: no window, no effects run
|
|
418
438
|
renderToString(React.createElement(TestComponent));
|
|
419
439
|
|
|
@@ -24,8 +24,8 @@ export interface Button {
|
|
|
24
24
|
preserveQueryParameters: boolean; // non-null in your model
|
|
25
25
|
badgeIcon?: Asset | null;
|
|
26
26
|
buttonVariant?: "primary_brand" | "primary_inverse" | "secondary" | null;
|
|
27
|
-
|
|
28
|
-
buttonIconPosition?:
|
|
27
|
+
buttonIconName?: string | null;
|
|
28
|
+
buttonIconPosition?: "left" | "right" | null;
|
|
29
29
|
clickToOpen?: "accordion" | "modal" | "tab" | null;
|
|
30
30
|
tabmodalNameToOpen?: string | null;
|
|
31
31
|
preDefinedFunctionExecution?: "check availability" | null;
|