@windstream/react-shared-components 0.2.48 → 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.
- package/dist/contentful/index.d.ts +10 -0
- 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 +48 -6
- package/dist/index.d.ts +48 -6
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- 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 +2 -2
- package/src/components/precisely-address-autocomplete/PreciselyAddressAutocomplete.stories.tsx +69 -0
- package/src/components/precisely-address-autocomplete/index.test.tsx +159 -0
- package/src/components/precisely-address-autocomplete/index.tsx +219 -0
- package/src/components/precisely-address-autocomplete/types.ts +54 -0
- package/src/contentful/blocks/callout/index.test.tsx +2 -2
- package/src/contentful/blocks/callout/index.tsx +1 -0
- package/src/contentful/blocks/cards/blog-card/index.tsx +9 -2
- package/src/contentful/blocks/cards/blog-card/types.ts +4 -0
- package/src/contentful/blocks/cards/floating-image-card/index.tsx +24 -9
- package/src/contentful/blocks/cards/floating-image-card/types.ts +4 -0
- package/src/contentful/blocks/cards/full-image-card/index.tsx +2 -1
- package/src/contentful/blocks/cards/full-image-card/types.ts +4 -0
- package/src/contentful/blocks/cards/simple-card/index.tsx +4 -3
- package/src/contentful/blocks/cards/simple-card/types.ts +4 -0
- package/src/contentful/blocks/find-kinetic/index.tsx +20 -7
- package/src/contentful/blocks/find-kinetic/types.ts +1 -0
- package/src/contentful/blocks/image-promo-bar/index.tsx +2 -1
- package/src/contentful/blocks/image-promo-bar/types.ts +1 -0
- package/src/contentful/blocks/primary-hero/index.tsx +6 -6
- package/src/hooks/contentful/use-contentful-rich-text.test.tsx +6 -6
- package/src/index.ts +8 -0
|
@@ -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"}
|
|
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
|
|
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 ? "
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
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={
|
|
@@ -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-
|
|
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-[
|
|
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-[
|
|
364
|
+
hasDesktopVideo && "h-[584px] w-[584px]"
|
|
365
365
|
)}
|
|
366
366
|
>
|
|
367
|
-
<Badge className="absolute -left-
|
|
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={
|
|
374
|
-
height={
|
|
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
|
|
246
|
+
expect(a).toHaveAttribute("rel", "noopener");
|
|
247
247
|
});
|
|
248
248
|
|
|
249
|
-
it("renders internal link
|
|
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"
|
|
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"
|
|
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
|
|
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"
|
|
545
|
+
expect(a).not.toHaveAttribute("target");
|
|
546
546
|
});
|
|
547
547
|
|
|
548
548
|
it("handles hyperlink with missing uri data", () => {
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,14 @@ export type { ButtonProps } from "./components/button";
|
|
|
8
8
|
export { Input, InputField, Input as TextInput } from "./components/input";
|
|
9
9
|
export type { InputProps, InputFieldProps } from "./components/input";
|
|
10
10
|
|
|
11
|
+
export { AddressAutocomplete } from "./components/precisely-address-autocomplete";
|
|
12
|
+
export type {
|
|
13
|
+
AddressAutocompleteAddress,
|
|
14
|
+
AddressAutocompleteProps,
|
|
15
|
+
AddressAutocompleteResult,
|
|
16
|
+
AddressAutocompleteSuggestion,
|
|
17
|
+
} from "./components/precisely-address-autocomplete";
|
|
18
|
+
|
|
11
19
|
export { Image } from "./components/image";
|
|
12
20
|
export type { ImageProps, ImageComponentProps } from "./components/image";
|
|
13
21
|
|