@windstream/react-shared-components 0.2.49 → 0.2.50

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.
@@ -97,7 +97,7 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
97
97
  >
98
98
  <NextImage
99
99
  src={card.image}
100
- alt={card.imageAlt ?? card.title ?? "card-image"}
100
+ alt={card.imageAltText ?? card.imageDescription ?? card.imageAlt ?? card.title ?? "card-image"}
101
101
  width={card.imageWidth || 400}
102
102
  height={card.imageHeight || 280}
103
103
  className={cx("w-full", !margin && "rounded-t-3xl")}
@@ -124,7 +124,7 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
124
124
  >
125
125
  <NextImage
126
126
  src={card.image}
127
- alt={card.imageAlt ?? card.title ?? "card-icon"}
127
+ alt={card.imageAltText ?? card.imageDescription ?? card.imageAlt ?? card.title ?? "card-icon"}
128
128
  width={imgWidth}
129
129
  height={imgHeight}
130
130
  className={cx(
@@ -17,6 +17,10 @@ export type Item = {
17
17
  title?: string;
18
18
  image?: string;
19
19
  imageAlt?: string;
20
+ /** Explicit image alt text; takes priority over the description fallback. */
21
+ imageAltText?: string;
22
+ /** Contentful asset description — used as the alt-text fallback. */
23
+ imageDescription?: string;
20
24
  imageWidth?: number;
21
25
  imageHeight?: number;
22
26
  imageAlignment?: "left" | "right" | "center";
@@ -10,6 +10,7 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
10
10
  description,
11
11
  enableHeading,
12
12
  image,
13
+ imageAltText,
13
14
  list = [],
14
15
  localPathPrefix = "/local",
15
16
  subTitle,
@@ -48,12 +49,12 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
48
49
  className={`${bgColorClasses[background]} component-container overflow-hidden ${color == "dark" ? "text-text" : "text-white"}`}
49
50
  >
50
51
  <div
51
- className={`${maxWidth ? "max-w-120 xl:mx-auto" : ""} mx-5 mb-5 ${image ? "mt-12" : "mt-0 xl:mt-0"} xl:my-20 md:px-5 xl:px-10`}
52
+ className={`${maxWidth ? "max-w-120 xl:mx-auto" : ""} mx-5 mb-5 ${image ? "mt-12" : "mt-0 xl:mt-0"} md:px-5 xl:my-20 xl:px-10`}
52
53
  >
53
54
  {title && (
54
55
  <Text
55
56
  as={enableHeading ? "h1" : "h2"}
56
- className="heading2 md:heading1 text-center"
57
+ className="heading2 text-center md:heading1"
57
58
  >
58
59
  {title}
59
60
  </Text>
@@ -71,10 +72,13 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
71
72
  className={`mt-8 flex flex-col items-center xl:flex-row ${image ? "xl:mt-16" : "xl:mt-10"} gap-10`}
72
73
  >
73
74
  <div
74
- className={`flex flex-col gap-10 self-stretch xl:flex-[1_0_0] ${image ? "xl:items-start pl-2 md:px-4 lg:pl-12 xl:pl-16" : "items-center"}`}
75
+ className={`flex flex-col gap-10 self-stretch xl:flex-[1_0_0] ${image ? "pl-2 md:px-4 lg:pl-12 xl:items-start xl:pl-16" : "items-center"}`}
75
76
  >
76
77
  {description && (
77
- <Text as="p" className={`body1 text-center${image ? " lg:text-left" : ""}`}>
78
+ <Text
79
+ as="p"
80
+ className={`body1 text-center${image ? "lg:text-left" : ""}`}
81
+ >
78
82
  {description}
79
83
  </Text>
80
84
  )}
@@ -122,7 +126,9 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
122
126
  for (let row = 0; row < numRows; row++) {
123
127
  for (let col = 0; col < numColumns; col++) {
124
128
  const index = col * numRows + row;
125
- rearranged.push(index < sortedList.length ? sortedList[index] : null); // ← holds position
129
+ rearranged.push(
130
+ index < sortedList.length ? sortedList[index] : null
131
+ ); // ← holds position
126
132
  }
127
133
  }
128
134
  return rearranged.map((item, index: number) =>
@@ -156,7 +162,9 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
156
162
  for (let row = 0; row < numRows; row++) {
157
163
  for (let col = 0; col < numColumns; col++) {
158
164
  const index = col * numRows + row;
159
- rearranged.push(index < sortedList.length ? sortedList[index] : null);
165
+ rearranged.push(
166
+ index < sortedList.length ? sortedList[index] : null
167
+ );
160
168
  }
161
169
  }
162
170
  return rearranged.map((item, index: number) =>
@@ -184,7 +192,12 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
184
192
  </div>
185
193
  {image && (
186
194
  <aside className="hidden md:block">
187
- <NextImage width={472} height={100} src={image} alt="image" />
195
+ <NextImage
196
+ width={472}
197
+ height={100}
198
+ src={image}
199
+ alt={imageAltText ?? "image"}
200
+ />
188
201
  </aside>
189
202
  )}
190
203
  </div>
@@ -6,6 +6,7 @@ export type FindKineticProps = {
6
6
  localPathPrefix?: string;
7
7
  background?: "blue" | "green" | "navy" | "purple" | "white" | "yellow";
8
8
  image?: string;
9
+ imageAltText?: string;
9
10
  list?: { name: string; code: string }[];
10
11
  maxWidth?: boolean;
11
12
  color?: "dark" | "light";
@@ -19,6 +19,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
19
19
  disclaimer,
20
20
  description,
21
21
  image,
22
+ imageAltText,
22
23
  imageLinks,
23
24
  mediaPosition = true,
24
25
  checklist,
@@ -174,7 +175,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
174
175
  >
175
176
  <NextImage
176
177
  src={image}
177
- alt="section-image"
178
+ alt={imageAltText ?? "section-image"}
178
179
  priority={isAboveTheFold}
179
180
  fill={!useOriginalImageAspectRatio}
180
181
  width={
@@ -9,6 +9,7 @@ export type ImagePromoBarProps = {
9
9
  title: string;
10
10
  subTitle: string;
11
11
  image: string;
12
+ imageAltText?: string;
12
13
  imageWidth: number;
13
14
  imageHeight: number;
14
15
  useOriginalImageAspectRatio?: boolean;
@@ -75,7 +75,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
75
75
  />
76
76
  ) : null;
77
77
  return (
78
- <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">
78
+ <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-4">
79
79
  {hasDesktopVideo ? (
80
80
  <video
81
81
  autoPlay={true}
@@ -98,7 +98,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
98
98
  {/* Left column: navy background, headline, body, address, button, link */}
99
99
  <div
100
100
  className={cx(
101
- `relative flex flex-col ${textColorClass} w-full xl:w-[485px]`
101
+ `relative flex flex-col ${textColorClass} w-full xl:w-[486px]`
102
102
  )}
103
103
  >
104
104
  <div className="flex flex-col gap-5 lg:gap-6">
@@ -361,17 +361,17 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
361
361
  <div
362
362
  className={cx(
363
363
  "relative hidden xl:block",
364
- hasDesktopVideo && "h-[600px] w-[600px]"
364
+ hasDesktopVideo && "h-[584px] w-[584px]"
365
365
  )}
366
366
  >
367
- <Badge className="absolute -left-10 top-18 z-10 aspect-square w-52 object-cover object-center" />
367
+ <Badge className="absolute -left-[114px] top-[62px] z-10 aspect-square w-[200px] object-cover object-center" />
368
368
  {!hasDesktopVideo && heroImageUrl ? (
369
369
  <NextImage
370
370
  src={heroImageUrl}
371
371
  alt={"Hero"}
372
372
  className="aspect-square rounded-[40px] object-cover object-center"
373
- width={600}
374
- height={600}
373
+ width={584}
374
+ height={584}
375
375
  quality={90}
376
376
  loading="eager"
377
377
  />
@@ -243,14 +243,14 @@ describe("renderContentfulRichText", () => {
243
243
  const a = container.querySelector("a")!;
244
244
  expect(a).toHaveAttribute("href", "https://example.com");
245
245
  expect(a).toHaveAttribute("target", "_blank");
246
- expect(a).toHaveAttribute("rel", "noopener noreferrer");
246
+ expect(a).toHaveAttribute("rel", "noopener");
247
247
  });
248
248
 
249
- it("renders internal link with target=_self for relative URLs", () => {
249
+ it("renders internal link without target for relative URLs", () => {
250
250
  const doc = makeDoc(makeHyperlink("/about", "About"));
251
251
  const { container } = render(<>{renderContentfulRichText(doc)}</>);
252
252
  const a = container.querySelector("a")!;
253
- expect(a).toHaveAttribute("target", "_self");
253
+ expect(a).not.toHaveAttribute("target");
254
254
  expect(a).not.toHaveAttribute("rel");
255
255
  });
256
256
 
@@ -265,7 +265,7 @@ describe("renderContentfulRichText", () => {
265
265
  const doc = makeDoc(makeHyperlink("https://example.com", "External"));
266
266
  const { container } = render(<>{renderContentfulRichText(doc, false)}</>);
267
267
  const a = container.querySelector("a")!;
268
- expect(a).toHaveAttribute("target", "_self");
268
+ expect(a).not.toHaveAttribute("target");
269
269
  });
270
270
 
271
271
  it("applies custom linkClassName", () => {
@@ -536,13 +536,13 @@ describe("renderContentfulRichText", () => {
536
536
  expect(a).toHaveAttribute("target", "_blank");
537
537
  });
538
538
 
539
- it("renders internal link with _self when target is undefined", () => {
539
+ it("renders internal link without target when target is undefined", () => {
540
540
  const doc = makeDoc(makeHyperlink("/page", "Page"));
541
541
  const { container } = render(
542
542
  <>{renderContentfulRichText(doc, undefined)}</>
543
543
  );
544
544
  const a = container.querySelector("a")!;
545
- expect(a).toHaveAttribute("target", "_self");
545
+ expect(a).not.toHaveAttribute("target");
546
546
  });
547
547
 
548
548
  it("handles hyperlink with missing uri data", () => {