@windstream/react-shared-components 0.2.38 → 0.2.39
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 +0 -1
- package/dist/contentful/index.esm.js +1 -1
- 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/styles.css +1 -1
- package/package.json +1 -1
- package/src/contentful/blocks/cards/blog-card/index.test.tsx +18 -42
- package/src/contentful/blocks/cards/blog-card/index.tsx +47 -63
- package/src/contentful/blocks/cards/blog-card/types.ts +0 -1
- package/src/contentful/blocks/primary-hero/index.tsx +5 -1
|
@@ -2,8 +2,6 @@ import React from "react";
|
|
|
2
2
|
import { BlogCardProps } from "./types";
|
|
3
3
|
import * as _NextLink from "next/link";
|
|
4
4
|
|
|
5
|
-
// import { Button } from "@shared/components/button";
|
|
6
|
-
import { MaterialIcon } from "@shared/components/material-icon";
|
|
7
5
|
import { Text } from "@shared/components/text";
|
|
8
6
|
|
|
9
7
|
// CJS/ESM interop: next/link uses standard __esModule exports so this is safe.
|
|
@@ -21,13 +19,12 @@ export const BlogCard: React.FC<BlogCardProps> = ({
|
|
|
21
19
|
category,
|
|
22
20
|
image,
|
|
23
21
|
imageComponent: ImageComponent,
|
|
24
|
-
readMoreText = "Read more",
|
|
25
22
|
asGrid = true,
|
|
26
23
|
index,
|
|
27
24
|
}: BlogCardProps) => {
|
|
28
25
|
const parentClassName = asGrid
|
|
29
|
-
? "flex h-full flex-col overflow-hidden rounded-card-lg bg-white shadow-drop transition-all duration-200 hover:-translate-y-0.5 hover:shadow-cardDrop"
|
|
30
|
-
: `callout-card w-full flex h-full flex-col overflow-hidden`;
|
|
26
|
+
? "group relative flex h-full flex-col overflow-hidden rounded-card-lg bg-white shadow-drop transition-all duration-200 hover:-translate-y-0.5 hover:shadow-cardDrop"
|
|
27
|
+
: `callout-card group relative w-full flex h-full flex-col overflow-hidden`;
|
|
31
28
|
|
|
32
29
|
return (
|
|
33
30
|
<article
|
|
@@ -38,42 +35,40 @@ export const BlogCard: React.FC<BlogCardProps> = ({
|
|
|
38
35
|
>
|
|
39
36
|
{/* Image (hidden in list view) */}
|
|
40
37
|
{asGrid && (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
ImageComponent
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/>
|
|
53
|
-
) : (
|
|
54
|
-
<img
|
|
55
|
-
src={image.src}
|
|
56
|
-
alt={image.alt}
|
|
57
|
-
width={image.width}
|
|
58
|
-
height={image.height}
|
|
59
|
-
loading="lazy"
|
|
60
|
-
decoding="async"
|
|
61
|
-
className="h-full w-full object-cover transition-transform duration-300 hover:scale-[1.03]"
|
|
62
|
-
/>
|
|
63
|
-
)
|
|
38
|
+
<div className="block h-[232px] w-full flex-shrink-0 overflow-hidden bg-gray-100">
|
|
39
|
+
{image ? (
|
|
40
|
+
ImageComponent ? (
|
|
41
|
+
<ImageComponent
|
|
42
|
+
src={image.src}
|
|
43
|
+
alt={image.alt}
|
|
44
|
+
width={image.width}
|
|
45
|
+
height={image.height}
|
|
46
|
+
className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-[1.03]"
|
|
47
|
+
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
|
48
|
+
/>
|
|
64
49
|
) : (
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
<img
|
|
51
|
+
src={image.src}
|
|
52
|
+
alt={image.alt}
|
|
53
|
+
width={image.width}
|
|
54
|
+
height={image.height}
|
|
55
|
+
loading="lazy"
|
|
56
|
+
decoding="async"
|
|
57
|
+
className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-[1.03]"
|
|
68
58
|
/>
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
)
|
|
60
|
+
) : (
|
|
61
|
+
<div
|
|
62
|
+
className="h-full w-full bg-gradient-to-br from-gray-200 to-gray-100"
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
72
67
|
)}
|
|
73
68
|
|
|
74
69
|
{/* Body */}
|
|
75
70
|
<div
|
|
76
|
-
className={`flex flex-1 flex-col
|
|
71
|
+
className={`flex flex-1 flex-col ${
|
|
77
72
|
asGrid ? "gap-5 p-6 md:p-8" : "gap-1 border-b p-3 md:p-4"
|
|
78
73
|
}`}
|
|
79
74
|
>
|
|
@@ -94,12 +89,14 @@ export const BlogCard: React.FC<BlogCardProps> = ({
|
|
|
94
89
|
|
|
95
90
|
{/* Title */}
|
|
96
91
|
{title && (
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
<Text as="h2" className="heading6">
|
|
93
|
+
<Link
|
|
94
|
+
href={href}
|
|
95
|
+
className="m-0 line-clamp-3 font-black transition-colors duration-150 after:absolute after:inset-0 after:z-10 after:content-[''] hover:text-text-brand group-hover:text-text-brand"
|
|
96
|
+
>
|
|
97
|
+
{title}
|
|
98
|
+
</Link>
|
|
99
|
+
</Text>
|
|
103
100
|
)}
|
|
104
101
|
|
|
105
102
|
{/* Excerpt */}
|
|
@@ -108,29 +105,16 @@ export const BlogCard: React.FC<BlogCardProps> = ({
|
|
|
108
105
|
{description}
|
|
109
106
|
</Text>
|
|
110
107
|
)}
|
|
111
|
-
|
|
112
|
-
{/* Read more (hidden in list view) */}
|
|
113
|
-
{asGrid && (
|
|
114
|
-
<Link
|
|
115
|
-
href={href}
|
|
116
|
-
className="group mt-auto inline-flex items-center justify-start gap-2 pt-3 text-sm text-text-brand no-underline"
|
|
117
|
-
aria-label={`${readMoreText} about ${title || "this article"}`}
|
|
118
|
-
>
|
|
119
|
-
<Text
|
|
120
|
-
aria-label={`${readMoreText} about ${title || "this article"}`}
|
|
121
|
-
className="label1 text-nowrap"
|
|
122
|
-
>
|
|
123
|
-
{readMoreText}
|
|
124
|
-
</Text>
|
|
125
|
-
<MaterialIcon
|
|
126
|
-
name="expand_circle_right"
|
|
127
|
-
fill={1}
|
|
128
|
-
size={24}
|
|
129
|
-
weight="200"
|
|
130
|
-
/>
|
|
131
|
-
</Link>
|
|
132
|
-
)}
|
|
133
108
|
</div>
|
|
109
|
+
|
|
110
|
+
{/* Fallback stretched link keeps the card navigable when no title link is rendered */}
|
|
111
|
+
{!title && (
|
|
112
|
+
<Link
|
|
113
|
+
href={href}
|
|
114
|
+
aria-label={category ?? "Read more"}
|
|
115
|
+
className="absolute inset-0 z-10"
|
|
116
|
+
/>
|
|
117
|
+
)}
|
|
134
118
|
</article>
|
|
135
119
|
);
|
|
136
120
|
};
|
|
@@ -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 ? (
|