@windstream/react-shared-components 0.0.93 → 0.0.95
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 +39 -31
- 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 +12 -5
- package/dist/index.d.ts +8 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +9 -2
- package/src/components/accordion/types.ts +1 -0
- package/src/components/alert-card/index.tsx +6 -1
- package/src/components/alert-card/types.ts +1 -0
- package/src/components/select-plan-button/index.tsx +40 -14
- package/src/components/select-plan-button/types.ts +9 -0
- package/src/contentful/blocks/accordion/index.tsx +3 -1
- package/src/contentful/blocks/button/index.tsx +33 -25
- package/src/contentful/blocks/button/types.ts +3 -0
- package/src/contentful/blocks/cards/product-card/index.tsx +10 -3
- package/src/contentful/blocks/cards/product-card/types.ts +8 -1
- package/src/contentful/blocks/cards/simple-card/index.tsx +12 -1
- package/src/contentful/blocks/cards/simple-card/types.ts +2 -5
- package/src/contentful/blocks/carousel/helper.tsx +10 -3
- package/src/contentful/blocks/carousel/index.tsx +8 -2
- package/src/contentful/blocks/carousel/types.ts +5 -1
- package/src/contentful/blocks/cta-callout/index.tsx +7 -1
- package/src/contentful/blocks/cta-callout/types.ts +4 -0
- package/src/contentful/blocks/find-kinetic/index.tsx +2 -2
- package/src/contentful/blocks/image-promo-bar/index.tsx +3 -0
- package/src/types/micro-components.ts +10 -0
- package/tailwind.config.cjs +4 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Button } from "../../button";
|
|
2
3
|
import { backgroundColorMap, Item, SimpleCardProps } from "./types";
|
|
3
4
|
|
|
4
5
|
import { NextImage } from "@shared/components/next-image";
|
|
@@ -53,7 +54,7 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
|
|
|
53
54
|
className={`callout-card ${mdWidth} ${lgWidth} w-full ${backgroundColorMap[card.backgroundColor ?? ""] ?? ""}`}
|
|
54
55
|
>
|
|
55
56
|
<div
|
|
56
|
-
className={`card-template flex h-full flex-col items-center gap-
|
|
57
|
+
className={`card-template flex h-full flex-col items-center gap-8 p-8 text-center ${imageAlignClass}`}
|
|
57
58
|
>
|
|
58
59
|
<div className="card-header">{imageRenderer(card)}</div>
|
|
59
60
|
|
|
@@ -69,6 +70,16 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
|
|
|
69
70
|
</Text>
|
|
70
71
|
)}
|
|
71
72
|
</div>
|
|
73
|
+
{card.cta && (
|
|
74
|
+
<div className="card-footer">
|
|
75
|
+
<Button
|
|
76
|
+
linkVariant="unstyled"
|
|
77
|
+
linkClassName="label1 flex items-center text-text gap-2"
|
|
78
|
+
{...card.cta}
|
|
79
|
+
iconName={"expand_circle_right"}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
72
83
|
</div>
|
|
73
84
|
</div>
|
|
74
85
|
);
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { ButtonProps } from "../../button/types";
|
|
2
3
|
|
|
3
4
|
export type Item = {
|
|
4
5
|
title?: string;
|
|
5
6
|
image?: string;
|
|
6
7
|
imageAlignment?: "left" | "right" | "center";
|
|
7
8
|
imageView?: "standard" | "icon" | "full";
|
|
8
|
-
cta?:
|
|
9
|
-
label?: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
newTab?: boolean;
|
|
12
|
-
};
|
|
9
|
+
cta?: ButtonProps;
|
|
13
10
|
ctaAlignment?: "left" | "right" | "center";
|
|
14
11
|
body?: ReactNode;
|
|
15
12
|
backgroundColor?: string;
|
|
@@ -11,12 +11,16 @@ import { Button } from "@shared/components/button";
|
|
|
11
11
|
import { MaterialIcon } from "@shared/components/material-icon";
|
|
12
12
|
import { ProductCard } from "@shared/contentful/blocks/cards/product-card";
|
|
13
13
|
import { TestimonialCard } from "@shared/contentful/blocks/cards/testimonial-card";
|
|
14
|
+
import { CheckPlansProps } from "@shared/types/micro-components";
|
|
14
15
|
import { cx } from "@shared/utils";
|
|
15
16
|
|
|
16
17
|
export function ProductCardCarousel({
|
|
17
18
|
fields,
|
|
19
|
+
renderCheckPlans,
|
|
18
20
|
}: {
|
|
19
21
|
fields: CarouselWithProductCards;
|
|
22
|
+
onModalButtonClick?: (id?: string) => void;
|
|
23
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
20
24
|
}) {
|
|
21
25
|
const itemsExpanded = fields?.items?.items?.[0]?.benefitsExpanded || false;
|
|
22
26
|
const [desktopExpanded, setDesktopExpanded] = useState(itemsExpanded);
|
|
@@ -79,8 +83,7 @@ export function ProductCardCarousel({
|
|
|
79
83
|
isMobileView: boolean = false
|
|
80
84
|
) => {
|
|
81
85
|
const planContent = item?.speed?.split("|");
|
|
82
|
-
const
|
|
83
|
-
const planName = `${techPrefix}${planContent?.[0] || ""}`;
|
|
86
|
+
const planName = planContent?.[0] || "";
|
|
84
87
|
const planSubtext = planContent?.[1] || "";
|
|
85
88
|
const priceCents = item?.priceSuffix?.split("/")?.[0] || "00";
|
|
86
89
|
const formattedPrice = `${item?.price || "0"}.${priceCents}`;
|
|
@@ -134,6 +137,8 @@ export function ProductCardCarousel({
|
|
|
134
137
|
planName={planName}
|
|
135
138
|
planSubtext={planSubtext}
|
|
136
139
|
speed={item?.speed || ""}
|
|
140
|
+
techType={item?.techType || ""}
|
|
141
|
+
ismaxSpeed={item?.ismaxSpeed || ""}
|
|
137
142
|
price={formattedPrice}
|
|
138
143
|
description={item?.productCardDescription || ""}
|
|
139
144
|
giftBadge={rawBadge}
|
|
@@ -147,6 +152,8 @@ export function ProductCardCarousel({
|
|
|
147
152
|
onToggleExpand={handleToggle}
|
|
148
153
|
ctaText={item?.cta?.buttonLabel || "Select plan"}
|
|
149
154
|
onCtaClick={handleCtaClick}
|
|
155
|
+
renderCheckPlans={renderCheckPlans}
|
|
156
|
+
cta={item.cta}
|
|
150
157
|
hostType="smb"
|
|
151
158
|
/>
|
|
152
159
|
</div>
|
|
@@ -335,7 +342,7 @@ export const TabSwitch: React.FC<TabSwitchProps> = ({
|
|
|
335
342
|
key={tab}
|
|
336
343
|
onClick={() => onChange(tab)}
|
|
337
344
|
className={cx(
|
|
338
|
-
"min-w-[160px] whitespace-nowrap rounded-2xl px-4 py-2.5 text-label1 font-black transition-all duration-300",
|
|
345
|
+
"min-w-[160px] whitespace-nowrap rounded-2xl bg-[#EEEEEE] px-4 py-2.5 text-label1 font-black transition-all duration-300",
|
|
339
346
|
activeTab === tab
|
|
340
347
|
? "bg-bg-fill-brand text-white shadow-md"
|
|
341
348
|
: "text-text-info hover:bg-[#E5E5E7]"
|
|
@@ -20,6 +20,8 @@ export const Carousel: React.FC<CarouselProps> = ({
|
|
|
20
20
|
activeTab,
|
|
21
21
|
setActiveTab,
|
|
22
22
|
tabs,
|
|
23
|
+
onModalButtonClick,
|
|
24
|
+
renderCheckPlans,
|
|
23
25
|
showSwitch = false,
|
|
24
26
|
}) => {
|
|
25
27
|
return (
|
|
@@ -55,9 +57,13 @@ export const Carousel: React.FC<CarouselProps> = ({
|
|
|
55
57
|
/>
|
|
56
58
|
)}
|
|
57
59
|
{hasProductCards && (
|
|
58
|
-
<ProductCardCarousel
|
|
60
|
+
<ProductCardCarousel
|
|
61
|
+
onModalButtonClick={onModalButtonClick}
|
|
62
|
+
renderCheckPlans={renderCheckPlans}
|
|
63
|
+
fields={fields as CarouselWithProductCards}
|
|
64
|
+
/>
|
|
59
65
|
)}
|
|
60
|
-
<Text as="div" className="body1 mt-8 px-4 text-center">
|
|
66
|
+
<Text as="div" className="body1 mt-8 px-4 text-center text-neutral-600">
|
|
61
67
|
{disclaimerText}
|
|
62
68
|
</Text>
|
|
63
69
|
</div>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import { CheckPlansProps } from "@shared/types/micro-components";
|
|
2
4
|
|
|
3
5
|
export interface carouselFieldsInterface {
|
|
4
6
|
__typename: "ComponentCarousel";
|
|
@@ -127,6 +129,8 @@ export type CarouselProps = {
|
|
|
127
129
|
setActiveTab: (tab: string) => void;
|
|
128
130
|
tabs: string[];
|
|
129
131
|
showSwitch?: boolean;
|
|
132
|
+
onModalButtonClick?: (id?: string) => void;
|
|
133
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
130
134
|
};
|
|
131
135
|
|
|
132
136
|
export interface TabSwitchProps {
|
|
@@ -15,6 +15,8 @@ export const CtaCallout: React.FC<CtaCalloutProps> = ({
|
|
|
15
15
|
enableHeading,
|
|
16
16
|
subTitle,
|
|
17
17
|
maxWidth = true,
|
|
18
|
+
onModalButtonClick,
|
|
19
|
+
renderCheckPlans,
|
|
18
20
|
}) => {
|
|
19
21
|
const bgColorClasses: Record<ThemeKey, string> = {
|
|
20
22
|
blue: "bg-[#07B2E2]",
|
|
@@ -45,7 +47,11 @@ export const CtaCallout: React.FC<CtaCalloutProps> = ({
|
|
|
45
47
|
{description}
|
|
46
48
|
</div>
|
|
47
49
|
<div className="flex justify-center pt-5 lg:pt-14">
|
|
48
|
-
<Button
|
|
50
|
+
<Button
|
|
51
|
+
{...button}
|
|
52
|
+
renderCheckPlans={renderCheckPlans}
|
|
53
|
+
onModalButtonClick={onModalButtonClick}
|
|
54
|
+
/>
|
|
49
55
|
</div>
|
|
50
56
|
</div>
|
|
51
57
|
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
import { CheckPlansProps } from "@shared/types/micro-components";
|
|
4
|
+
|
|
3
5
|
export type CtaCalloutProps = {
|
|
4
6
|
title?: string;
|
|
5
7
|
subTitle?: string;
|
|
@@ -11,6 +13,8 @@ export type CtaCalloutProps = {
|
|
|
11
13
|
contentAlignment?: "center" | "left" | "right";
|
|
12
14
|
button?: any;
|
|
13
15
|
maxWidth?: boolean;
|
|
16
|
+
onModalButtonClick?: (id?: string) => void;
|
|
17
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
export type ThemeKey =
|
|
@@ -75,7 +75,7 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
|
|
|
75
75
|
}
|
|
76
76
|
return rearranged.map((item, index: number) => (
|
|
77
77
|
<li key={`item-list-2-${index}`}>
|
|
78
|
-
<Link href={
|
|
78
|
+
<Link href={`/local/${item.code.toLowerCase()}`} className="label1">
|
|
79
79
|
{item.name}
|
|
80
80
|
</Link>
|
|
81
81
|
</li>
|
|
@@ -100,7 +100,7 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
|
|
|
100
100
|
}
|
|
101
101
|
return rearranged.map((item, index: number) => (
|
|
102
102
|
<li key={`item-list-3-${index}`}>
|
|
103
|
-
<Link href={
|
|
103
|
+
<Link href={`/local/${item.code.toLowerCase()}`} className="label1">
|
|
104
104
|
{item.name}
|
|
105
105
|
</Link>
|
|
106
106
|
</li>
|
|
@@ -32,6 +32,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
32
32
|
imageWidth = 660,
|
|
33
33
|
imageHeight = 660,
|
|
34
34
|
onModalButtonClick,
|
|
35
|
+
renderCheckPlans,
|
|
35
36
|
}) => {
|
|
36
37
|
const [activeVideo, setActiveVideo] = useState("");
|
|
37
38
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -130,6 +131,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
130
131
|
<Button
|
|
131
132
|
{...cta}
|
|
132
133
|
fullWidth={true}
|
|
134
|
+
renderCheckPlans={renderCheckPlans}
|
|
133
135
|
onModalButtonClick={onModalButtonClick}
|
|
134
136
|
/>
|
|
135
137
|
</div>
|
|
@@ -139,6 +141,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
139
141
|
<Button
|
|
140
142
|
{...secondaryCta}
|
|
141
143
|
fullWidth={true}
|
|
144
|
+
renderCheckPlans={renderCheckPlans}
|
|
142
145
|
onModalButtonClick={onModalButtonClick}
|
|
143
146
|
/>
|
|
144
147
|
</div>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ButtonProps } from "@shared/contentful";
|
|
2
|
+
|
|
1
3
|
export interface Asset {
|
|
2
4
|
url?: string | null;
|
|
3
5
|
title?: string | null;
|
|
@@ -86,4 +88,12 @@ export type CheckPlansProps = {
|
|
|
86
88
|
ctaText?: string;
|
|
87
89
|
buttonVariant?: "primary_brand" | "secondary" | "primary_inverse";
|
|
88
90
|
showButtonAs?: "solid" | "unstyled" | "text" | undefined;
|
|
91
|
+
cta?: ButtonProps;
|
|
92
|
+
speedCardConfig?: {
|
|
93
|
+
isModalOpen?: boolean;
|
|
94
|
+
setModalOpen?: () => void;
|
|
95
|
+
speed?: string;
|
|
96
|
+
techType?: string;
|
|
97
|
+
isMax?: boolean;
|
|
98
|
+
};
|
|
89
99
|
};
|
package/tailwind.config.cjs
CHANGED
|
@@ -547,15 +547,19 @@ module.exports = {
|
|
|
547
547
|
const buttonComponents = {
|
|
548
548
|
".btn-small": {
|
|
549
549
|
height: theme("height.12"),
|
|
550
|
+
...typographyComponents[".label3"],
|
|
550
551
|
},
|
|
551
552
|
".btn-medium": {
|
|
552
553
|
height: theme("height.14"),
|
|
554
|
+
...typographyComponents[".label1"],
|
|
553
555
|
},
|
|
554
556
|
".btn-large": {
|
|
555
557
|
height: theme("height.16"),
|
|
558
|
+
...typographyComponents[".label1"]
|
|
556
559
|
},
|
|
557
560
|
".btn-x-large": {
|
|
558
561
|
height: theme("height.22"),
|
|
562
|
+
...typographyComponents[".heading5"]
|
|
559
563
|
},
|
|
560
564
|
};
|
|
561
565
|
|