@windstream/react-shared-components 0.0.37 → 0.0.38
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 +9 -29
- package/dist/contentful/index.esm.js +1 -1
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +1 -1
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +2 -2
- 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/accordion/index.tsx +49 -49
- package/src/components/alert-card/types.ts +9 -9
- package/src/components/brand-button/index.tsx +93 -93
- package/src/components/button/index.tsx +27 -27
- package/src/components/button/types.ts +14 -14
- package/src/components/checkbox/index.tsx +197 -197
- package/src/components/collapse/index.tsx +46 -46
- package/src/components/image/types.ts +33 -33
- package/src/components/input/index.tsx +6 -6
- package/src/components/link/index.tsx +97 -97
- package/src/components/link/types.ts +25 -25
- package/src/components/list/index.tsx +88 -88
- package/src/components/list/list-item/index.tsx +38 -38
- package/src/components/list/list-item/types.ts +13 -13
- package/src/components/list/types.ts +29 -29
- package/src/components/material-icon/index.tsx +44 -44
- package/src/components/material-icon/types.ts +31 -31
- package/src/components/modal/index.tsx +164 -164
- package/src/components/see-more/index.tsx +44 -44
- package/src/components/select/index.tsx +150 -150
- package/src/components/skeleton/index.tsx +61 -61
- package/src/components/text/index.tsx +25 -25
- package/src/components/text/types.ts +45 -45
- package/src/contentful/blocks/accordion/Accordion.stories.tsx +29 -29
- package/src/contentful/blocks/accordion/index.tsx +52 -52
- package/src/contentful/blocks/accordion/types.ts +17 -17
- package/src/contentful/blocks/button/index.tsx +5 -0
- package/src/contentful/blocks/button/types.ts +1 -0
- package/src/contentful/blocks/callout/Callout.stories.tsx +1 -1
- package/src/contentful/blocks/callout/index.tsx +15 -52
- package/src/contentful/blocks/callout/types.ts +1 -14
- package/src/contentful/blocks/find-kinetic/FindKinetic.stories.tsx +23 -23
- package/src/contentful/blocks/find-kinetic/index.tsx +80 -80
- package/src/contentful/blocks/find-kinetic/types.ts +18 -18
- package/src/contentful/blocks/footer/index.tsx +79 -79
- package/src/contentful/blocks/image-promo-bar/index.tsx +154 -154
- package/src/contentful/blocks/navigation/index.tsx +1 -2
- package/src/contentful/blocks/navigation/link-groups.tsx/index.tsx +64 -62
- package/src/contentful/blocks/primary-hero/index.tsx +163 -64
- package/src/contentful/blocks/primary-hero/types.ts +1 -0
- package/src/contentful/index.ts +45 -48
- package/src/hooks/use-body-scroll-lock.ts +34 -34
- package/src/setupTests.ts +46 -46
- package/src/contentful/blocks/cards/simple-card/index.tsx +0 -45
- package/src/contentful/blocks/cards/simple-card/types.ts +0 -11
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
11
|
-
brow,
|
|
12
|
-
enableHeading,
|
|
13
|
-
title,
|
|
14
|
-
subTitle,
|
|
15
|
-
ctaDisclaimer,
|
|
16
|
-
disclaimer,
|
|
17
|
-
description,
|
|
18
|
-
image,
|
|
19
|
-
imageLinks,
|
|
20
|
-
mediaPosition = true,
|
|
21
|
-
checklist,
|
|
22
|
-
secondaryCta,
|
|
23
|
-
cta,
|
|
24
|
-
videoLink,
|
|
25
|
-
maxWidth = true,
|
|
26
|
-
color = "light",
|
|
27
|
-
}) => {
|
|
28
|
-
return (
|
|
29
|
-
<div className="component-container">
|
|
30
|
-
<div
|
|
31
|
-
className={`image-promo-bar-content ${maxWidth ? "max-w-120 xl:mx-auto" : ""} mx-5 mb-8 mt-16`}
|
|
32
|
-
>
|
|
33
|
-
<div
|
|
34
|
-
className={`flex shrink-0 flex-col items-center gap-8 xl:gap-[126px] ${mediaPosition ? "flex-row xl:flex-row-reverse" : "xl:flex-row"}`}
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
className={`flex flex-[1_0_0] flex-col items-start justify-center gap-8 xl:gap-10 ${color == "dark" ? "text-text" : "text-white"}`}
|
|
38
|
-
>
|
|
39
|
-
<div className="heading holder">
|
|
40
|
-
{brow && (
|
|
41
|
-
<Text
|
|
42
|
-
as="div"
|
|
43
|
-
className="subheading4 mb-4 text-text-brand xl:subheading2 xl:mb-3"
|
|
44
|
-
>
|
|
45
|
-
{brow}
|
|
46
|
-
</Text>
|
|
47
|
-
)}
|
|
48
|
-
{title && (
|
|
49
|
-
<Text
|
|
50
|
-
as={enableHeading ? "h1" : "h2"}
|
|
51
|
-
className="heading2 xl:heading1"
|
|
52
|
-
>
|
|
53
|
-
{title}
|
|
54
|
-
</Text>
|
|
55
|
-
)}
|
|
56
|
-
{subTitle && (
|
|
57
|
-
<Text
|
|
58
|
-
as={enableHeading ? "h2" : "h3"}
|
|
59
|
-
className="subheading1 mt-3"
|
|
60
|
-
>
|
|
61
|
-
{subTitle}
|
|
62
|
-
</Text>
|
|
63
|
-
)}
|
|
64
|
-
</div>
|
|
65
|
-
{/* Content Section */}
|
|
66
|
-
{description && (
|
|
67
|
-
<Text as="div" className="body1">
|
|
68
|
-
{description}
|
|
69
|
-
</Text>
|
|
70
|
-
)}
|
|
71
|
-
{/* Checklist Rendering */}
|
|
72
|
-
{checklist.length > 0 && <Checklist items={checklist} />}
|
|
73
|
-
{/* Image Links Collection */}
|
|
74
|
-
{imageLinks?.map((link, index) => (
|
|
75
|
-
<div key={index} className="image-link">
|
|
76
|
-
<Image src={link.url} alt="icon-link" />
|
|
77
|
-
</div>
|
|
78
|
-
))}
|
|
79
|
-
{/* CTAs and Disclaimers */}
|
|
80
|
-
<div className="flex w-full flex-col gap-8 xl:flex-row xl:gap-3">
|
|
81
|
-
{cta && (
|
|
82
|
-
<div className="primary-cta w-full xl:w-auto">
|
|
83
|
-
<Button {...cta} fullWidth={true} />
|
|
84
|
-
</div>
|
|
85
|
-
)}
|
|
86
|
-
{secondaryCta && (
|
|
87
|
-
<div className="secondary-cta">
|
|
88
|
-
<Button {...secondaryCta} fullWidth={true} />
|
|
89
|
-
</div>
|
|
90
|
-
)}
|
|
91
|
-
</div>
|
|
92
|
-
{ctaDisclaimer && <div>{ctaDisclaimer}</div>}
|
|
93
|
-
{disclaimer && <div>{disclaimer}</div>}
|
|
94
|
-
</div>
|
|
95
|
-
<aside className="flex shrink-0 content-center items-center">
|
|
96
|
-
<div>
|
|
97
|
-
{/* Media Section */}
|
|
98
|
-
{image && (
|
|
99
|
-
<>
|
|
100
|
-
<NextImage
|
|
101
|
-
src={image}
|
|
102
|
-
alt="section-image"
|
|
103
|
-
width={486}
|
|
104
|
-
height={100}
|
|
105
|
-
className="hidden rounded-[40px] xl:block"
|
|
106
|
-
/>
|
|
107
|
-
<NextImage
|
|
108
|
-
src={image}
|
|
109
|
-
alt="section-image"
|
|
110
|
-
width={984}
|
|
111
|
-
height={100}
|
|
112
|
-
className="hidden rounded-[40px] lg:block xl:hidden"
|
|
113
|
-
/>
|
|
114
|
-
<NextImage
|
|
115
|
-
src={image}
|
|
116
|
-
alt="section-image"
|
|
117
|
-
width={728}
|
|
118
|
-
height={100}
|
|
119
|
-
className="hidden rounded-[40px] md:block lg:hidden"
|
|
120
|
-
/>
|
|
121
|
-
<NextImage
|
|
122
|
-
src={image}
|
|
123
|
-
alt="section-image"
|
|
124
|
-
width={350}
|
|
125
|
-
height={100}
|
|
126
|
-
className="block rounded-[40px] md:hidden"
|
|
127
|
-
/>
|
|
128
|
-
</>
|
|
129
|
-
)}
|
|
130
|
-
</div>
|
|
131
|
-
<div>
|
|
132
|
-
{/* Video Link Section */}
|
|
133
|
-
{videoLink?.link && (
|
|
134
|
-
<div className="video-section">
|
|
135
|
-
{videoLink.image && (
|
|
136
|
-
<NextImage
|
|
137
|
-
src={videoLink.image}
|
|
138
|
-
alt="Video preview"
|
|
139
|
-
width={486}
|
|
140
|
-
height={100}
|
|
141
|
-
className="rounded-[40px]"
|
|
142
|
-
/>
|
|
143
|
-
)}
|
|
144
|
-
</div>
|
|
145
|
-
)}
|
|
146
|
-
</div>
|
|
147
|
-
</aside>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export default ImagePromoBar;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ImagePromoBarProps } from "./types";
|
|
3
|
+
|
|
4
|
+
import { Checklist } from "@shared/components/checklist";
|
|
5
|
+
import { Image } from "@shared/components/image";
|
|
6
|
+
import { NextImage } from "@shared/components/next-image";
|
|
7
|
+
import { Text } from "@shared/components/text";
|
|
8
|
+
import { Button } from "@shared/contentful";
|
|
9
|
+
|
|
10
|
+
export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
11
|
+
brow,
|
|
12
|
+
enableHeading,
|
|
13
|
+
title,
|
|
14
|
+
subTitle,
|
|
15
|
+
ctaDisclaimer,
|
|
16
|
+
disclaimer,
|
|
17
|
+
description,
|
|
18
|
+
image,
|
|
19
|
+
imageLinks,
|
|
20
|
+
mediaPosition = true,
|
|
21
|
+
checklist,
|
|
22
|
+
secondaryCta,
|
|
23
|
+
cta,
|
|
24
|
+
videoLink,
|
|
25
|
+
maxWidth = true,
|
|
26
|
+
color = "light",
|
|
27
|
+
}) => {
|
|
28
|
+
return (
|
|
29
|
+
<div className="component-container">
|
|
30
|
+
<div
|
|
31
|
+
className={`image-promo-bar-content ${maxWidth ? "max-w-120 xl:mx-auto" : ""} mx-5 mb-8 mt-16`}
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
className={`flex shrink-0 flex-col items-center gap-8 xl:gap-[126px] ${mediaPosition ? "flex-row xl:flex-row-reverse" : "xl:flex-row"}`}
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
className={`flex flex-[1_0_0] flex-col items-start justify-center gap-8 xl:gap-10 ${color == "dark" ? "text-text" : "text-white"}`}
|
|
38
|
+
>
|
|
39
|
+
<div className="heading holder">
|
|
40
|
+
{brow && (
|
|
41
|
+
<Text
|
|
42
|
+
as="div"
|
|
43
|
+
className="subheading4 mb-4 text-text-brand xl:subheading2 xl:mb-3"
|
|
44
|
+
>
|
|
45
|
+
{brow}
|
|
46
|
+
</Text>
|
|
47
|
+
)}
|
|
48
|
+
{title && (
|
|
49
|
+
<Text
|
|
50
|
+
as={enableHeading ? "h1" : "h2"}
|
|
51
|
+
className="heading2 xl:heading1"
|
|
52
|
+
>
|
|
53
|
+
{title}
|
|
54
|
+
</Text>
|
|
55
|
+
)}
|
|
56
|
+
{subTitle && (
|
|
57
|
+
<Text
|
|
58
|
+
as={enableHeading ? "h2" : "h3"}
|
|
59
|
+
className="subheading1 mt-3"
|
|
60
|
+
>
|
|
61
|
+
{subTitle}
|
|
62
|
+
</Text>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
{/* Content Section */}
|
|
66
|
+
{description && (
|
|
67
|
+
<Text as="div" className="body1">
|
|
68
|
+
{description}
|
|
69
|
+
</Text>
|
|
70
|
+
)}
|
|
71
|
+
{/* Checklist Rendering */}
|
|
72
|
+
{checklist.length > 0 && <Checklist items={checklist} />}
|
|
73
|
+
{/* Image Links Collection */}
|
|
74
|
+
{imageLinks?.map((link, index) => (
|
|
75
|
+
<div key={index} className="image-link">
|
|
76
|
+
<Image src={link.url} alt="icon-link" />
|
|
77
|
+
</div>
|
|
78
|
+
))}
|
|
79
|
+
{/* CTAs and Disclaimers */}
|
|
80
|
+
<div className="flex w-full flex-col gap-8 xl:flex-row xl:gap-3">
|
|
81
|
+
{cta && (
|
|
82
|
+
<div className="primary-cta w-full xl:w-auto">
|
|
83
|
+
<Button {...cta} fullWidth={true} />
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
{secondaryCta && (
|
|
87
|
+
<div className="secondary-cta">
|
|
88
|
+
<Button {...secondaryCta} fullWidth={true} />
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
{ctaDisclaimer && <div>{ctaDisclaimer}</div>}
|
|
93
|
+
{disclaimer && <div>{disclaimer}</div>}
|
|
94
|
+
</div>
|
|
95
|
+
<aside className="flex shrink-0 content-center items-center">
|
|
96
|
+
<div>
|
|
97
|
+
{/* Media Section */}
|
|
98
|
+
{image && (
|
|
99
|
+
<>
|
|
100
|
+
<NextImage
|
|
101
|
+
src={image}
|
|
102
|
+
alt="section-image"
|
|
103
|
+
width={486}
|
|
104
|
+
height={100}
|
|
105
|
+
className="hidden rounded-[40px] xl:block"
|
|
106
|
+
/>
|
|
107
|
+
<NextImage
|
|
108
|
+
src={image}
|
|
109
|
+
alt="section-image"
|
|
110
|
+
width={984}
|
|
111
|
+
height={100}
|
|
112
|
+
className="hidden rounded-[40px] lg:block xl:hidden"
|
|
113
|
+
/>
|
|
114
|
+
<NextImage
|
|
115
|
+
src={image}
|
|
116
|
+
alt="section-image"
|
|
117
|
+
width={728}
|
|
118
|
+
height={100}
|
|
119
|
+
className="hidden rounded-[40px] md:block lg:hidden"
|
|
120
|
+
/>
|
|
121
|
+
<NextImage
|
|
122
|
+
src={image}
|
|
123
|
+
alt="section-image"
|
|
124
|
+
width={350}
|
|
125
|
+
height={100}
|
|
126
|
+
className="block rounded-[40px] md:hidden"
|
|
127
|
+
/>
|
|
128
|
+
</>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
<div>
|
|
132
|
+
{/* Video Link Section */}
|
|
133
|
+
{videoLink?.link && (
|
|
134
|
+
<div className="video-section">
|
|
135
|
+
{videoLink.image && (
|
|
136
|
+
<NextImage
|
|
137
|
+
src={videoLink.image}
|
|
138
|
+
alt="Video preview"
|
|
139
|
+
width={486}
|
|
140
|
+
height={100}
|
|
141
|
+
className="rounded-[40px]"
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
</aside>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default ImagePromoBar;
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
ButtonProps as ContentfulButtonProps,
|
|
5
|
+
} from "@shared/contentful";
|
|
6
|
+
|
|
7
|
+
type ComponentButtonGroup = {
|
|
8
|
+
anchorId?: string | null;
|
|
9
|
+
title?: string | null;
|
|
10
|
+
items?: { items?: ContentfulButtonProps[] | null } | null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type Link = ContentfulButtonProps | ComponentButtonGroup;
|
|
14
|
+
|
|
15
|
+
type LinkGroupsProps = {
|
|
16
|
+
link?: Link;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const isButton = (link: Link): link is ContentfulButtonProps => {
|
|
20
|
+
// If your group never has `href`, this is a simple and effective guard
|
|
21
|
+
return typeof (link as ContentfulButtonProps).href === "string";
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const LinkGroups: React.FC<LinkGroupsProps> = ({ link }) => {
|
|
25
|
+
if (!link) return null;
|
|
26
|
+
|
|
27
|
+
// Single button
|
|
28
|
+
if (isButton(link)) {
|
|
29
|
+
const key = "submenu-link-btn";
|
|
30
|
+
return (
|
|
31
|
+
<ul>
|
|
32
|
+
<li key={key} className="submenu-link">
|
|
33
|
+
<Button {...link} linkVariant="unstyled" />
|
|
34
|
+
</li>
|
|
35
|
+
</ul>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Group
|
|
40
|
+
const { anchorId, title, items } = link;
|
|
41
|
+
const subMenu = Array.isArray(items?.items) ? items!.items! : [];
|
|
42
|
+
|
|
43
|
+
const RenderSubMenu: React.FC<{ items: ContentfulButtonProps[] }> = ({
|
|
44
|
+
items,
|
|
45
|
+
}) => (
|
|
46
|
+
<ul>
|
|
47
|
+
{items.map((site, index) => {
|
|
48
|
+
const key = `submenu-link-${index}`;
|
|
49
|
+
return (
|
|
50
|
+
<li key={key} className="submenu-link">
|
|
51
|
+
<Button {...site} linkVariant="unstyled" />
|
|
52
|
+
</li>
|
|
53
|
+
);
|
|
54
|
+
})}
|
|
55
|
+
</ul>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div id={anchorId ?? undefined}>
|
|
60
|
+
<div>{title ?? null}</div>
|
|
61
|
+
{subMenu.length > 0 && <RenderSubMenu items={subMenu} />}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|