@windstream/react-shared-components 0.0.86 → 0.0.88
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/README.md +7 -1
- package/dist/contentful/index.d.ts +9 -5
- 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 +4 -4
- package/dist/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/components/material-icon/constants.ts +1 -0
- package/src/contentful/blocks/button/index.tsx +16 -2
- package/src/contentful/blocks/button/types.ts +6 -1
- package/src/contentful/blocks/image-promo-bar/index.tsx +11 -2
- package/src/contentful/blocks/image-promo-bar/types.ts +4 -0
- package/src/contentful/blocks/primary-hero/index.tsx +23 -7
- package/src/contentful/blocks/primary-hero/types.ts +6 -1
- package/src/types/micro-components.ts +9 -0
package/dist/core.d.ts
CHANGED
|
@@ -57,15 +57,15 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
|
57
57
|
|
|
58
58
|
declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
|
|
59
59
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
60
|
-
state?: "default" | "
|
|
61
|
-
size?: "
|
|
60
|
+
state?: "default" | "error" | "filled" | "active" | "focus" | "hover" | undefined;
|
|
61
|
+
size?: "medium" | "large" | "slim" | undefined;
|
|
62
62
|
label?: string | undefined;
|
|
63
63
|
errorText?: string | undefined;
|
|
64
64
|
prefixIconName?: "search" | "location_on" | undefined;
|
|
65
65
|
prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
66
66
|
prefixIconFill?: boolean | undefined;
|
|
67
67
|
suffixIconFill?: boolean | undefined;
|
|
68
|
-
suffixIconName?: "visibility" | "
|
|
68
|
+
suffixIconName?: "visibility" | "lock" | "visibility_off" | undefined;
|
|
69
69
|
suffixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
70
70
|
containerClassName?: string | undefined;
|
|
71
71
|
prefixIconClassName?: string | undefined;
|
|
@@ -168,7 +168,7 @@ declare const ListItem: React$1.ForwardRefExoticComponent<ListItemProps & React$
|
|
|
168
168
|
|
|
169
169
|
declare const List: React__default.ForwardRefExoticComponent<ListProps & React__default.RefAttributes<HTMLUListElement | HTMLOListElement>>;
|
|
170
170
|
|
|
171
|
-
declare const iconNameList: readonly ["info", "download", "featured_seasonal_and_gifts", "visibility", "paid", "check_box", "check_box_outline_blank", "radio_button_unchecked", "radio_button_checked", "counter_1", "counter_2", "counter_3", "error", "search", "cancel", "router", "broadcast_on_home", "check", "check_circle", "lock", "shield_lock", "phone_in_talk", "call", "chevron_left", "chevron_right", "keyboard_arrow_down", "keyboard_arrow_up", "arrow_back", "arrow_forward", "help", "home_pin", "location_on", "timer", "schedule", "add", "remove", "bolt", "rocket", "cloud_sync", "close", "groups", "speed", "mail", "credit_card", "language", "forum", "contract", "local_atm", "headset_mic", "sensors", "wifi", "settings", "home", "devices", "build", "thumb_up", "desktop_windows", "block", "all_inclusive", "verified_user", "extension", "stadia_controller", "visibility_off", "close_fullscreen", "progress_activity", "travel_explore", "share", "business_center", "upload", "videocam", "expand_circle_right", "add_circle", "do_not_disturb_on", "expand_circle_up", "expand_circle_down", "replay", "fiber_manual_record", "menu", "dangerous", "star"];
|
|
171
|
+
declare const iconNameList: readonly ["info", "download", "featured_seasonal_and_gifts", "visibility", "paid", "check_box", "check_box_outline_blank", "radio_button_unchecked", "radio_button_checked", "counter_1", "counter_2", "counter_3", "error", "search", "cancel", "router", "broadcast_on_home", "check", "check_circle", "lock", "shield_lock", "phone_in_talk", "call", "chevron_left", "chevron_right", "keyboard_arrow_down", "keyboard_arrow_up", "arrow_back", "arrow_forward", "help", "home_pin", "location_on", "timer", "schedule", "add", "remove", "bolt", "rocket", "cloud_sync", "close", "groups", "speed", "mail", "credit_card", "language", "forum", "contract", "local_atm", "headset_mic", "sensors", "wifi", "settings", "home", "devices", "build", "thumb_up", "desktop_windows", "block", "all_inclusive", "verified_user", "extension", "stadia_controller", "visibility_off", "close_fullscreen", "progress_activity", "travel_explore", "share", "business_center", "upload", "videocam", "expand_circle_right", "add_circle", "do_not_disturb_on", "expand_circle_up", "expand_circle_down", "replay", "fiber_manual_record", "menu", "dangerous", "star", "play_arrow"];
|
|
172
172
|
declare const OpticalSizes: readonly ["20dp", "24dp", "40dp", "48dp"];
|
|
173
173
|
declare const weights: readonly ["100", "200", "300", "400", "500", "600", "700"];
|
|
174
174
|
declare const emphasis: readonly [-25, 0, 200];
|
package/dist/index.d.ts
CHANGED
|
@@ -57,15 +57,15 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
|
57
57
|
|
|
58
58
|
declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
|
|
59
59
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
60
|
-
state?: "
|
|
61
|
-
size?: "
|
|
60
|
+
state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
|
|
61
|
+
size?: "slim" | "medium" | "large" | undefined;
|
|
62
62
|
label?: string | undefined;
|
|
63
63
|
errorText?: string | undefined;
|
|
64
64
|
prefixIconName?: "search" | "location_on" | undefined;
|
|
65
65
|
prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
66
66
|
prefixIconFill?: boolean | undefined;
|
|
67
67
|
suffixIconFill?: boolean | undefined;
|
|
68
|
-
suffixIconName?: "visibility" | "
|
|
68
|
+
suffixIconName?: "visibility" | "visibility_off" | "lock" | undefined;
|
|
69
69
|
suffixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
70
70
|
containerClassName?: string | undefined;
|
|
71
71
|
prefixIconClassName?: string | undefined;
|
|
@@ -168,7 +168,7 @@ declare const ListItem: React$1.ForwardRefExoticComponent<ListItemProps & React$
|
|
|
168
168
|
|
|
169
169
|
declare const List: React__default.ForwardRefExoticComponent<ListProps & React__default.RefAttributes<HTMLUListElement | HTMLOListElement>>;
|
|
170
170
|
|
|
171
|
-
declare const iconNameList: readonly ["info", "download", "featured_seasonal_and_gifts", "visibility", "paid", "check_box", "check_box_outline_blank", "radio_button_unchecked", "radio_button_checked", "counter_1", "counter_2", "counter_3", "error", "search", "cancel", "router", "broadcast_on_home", "check", "check_circle", "lock", "shield_lock", "phone_in_talk", "call", "chevron_left", "chevron_right", "keyboard_arrow_down", "keyboard_arrow_up", "arrow_back", "arrow_forward", "help", "home_pin", "location_on", "timer", "schedule", "add", "remove", "bolt", "rocket", "cloud_sync", "close", "groups", "speed", "mail", "credit_card", "language", "forum", "contract", "local_atm", "headset_mic", "sensors", "wifi", "settings", "home", "devices", "build", "thumb_up", "desktop_windows", "block", "all_inclusive", "verified_user", "extension", "stadia_controller", "visibility_off", "close_fullscreen", "progress_activity", "travel_explore", "share", "business_center", "upload", "videocam", "expand_circle_right", "add_circle", "do_not_disturb_on", "expand_circle_up", "expand_circle_down", "replay", "fiber_manual_record", "menu", "dangerous", "star"];
|
|
171
|
+
declare const iconNameList: readonly ["info", "download", "featured_seasonal_and_gifts", "visibility", "paid", "check_box", "check_box_outline_blank", "radio_button_unchecked", "radio_button_checked", "counter_1", "counter_2", "counter_3", "error", "search", "cancel", "router", "broadcast_on_home", "check", "check_circle", "lock", "shield_lock", "phone_in_talk", "call", "chevron_left", "chevron_right", "keyboard_arrow_down", "keyboard_arrow_up", "arrow_back", "arrow_forward", "help", "home_pin", "location_on", "timer", "schedule", "add", "remove", "bolt", "rocket", "cloud_sync", "close", "groups", "speed", "mail", "credit_card", "language", "forum", "contract", "local_atm", "headset_mic", "sensors", "wifi", "settings", "home", "devices", "build", "thumb_up", "desktop_windows", "block", "all_inclusive", "verified_user", "extension", "stadia_controller", "visibility_off", "close_fullscreen", "progress_activity", "travel_explore", "share", "business_center", "upload", "videocam", "expand_circle_right", "add_circle", "do_not_disturb_on", "expand_circle_up", "expand_circle_down", "replay", "fiber_manual_record", "menu", "dangerous", "star", "play_arrow"];
|
|
172
172
|
declare const OpticalSizes: readonly ["20dp", "24dp", "40dp", "48dp"];
|
|
173
173
|
declare const weights: readonly ["100", "200", "300", "400", "500", "600", "700"];
|
|
174
174
|
declare const emphasis: readonly [-25, 0, 200];
|
package/package.json
CHANGED
|
@@ -17,19 +17,33 @@ export const Button: React.FC<ButtonProps> = ({
|
|
|
17
17
|
linkVariant,
|
|
18
18
|
fullWidth,
|
|
19
19
|
preDefinedFunctionExecution,
|
|
20
|
-
|
|
20
|
+
renderCheckPlans,
|
|
21
21
|
buttonClassName,
|
|
22
|
+
clickToOpen,
|
|
23
|
+
tabmodalNameToOpen,
|
|
24
|
+
onModalButtonClick,
|
|
22
25
|
onClick,
|
|
23
26
|
...rest
|
|
24
27
|
}) => {
|
|
25
28
|
if (preDefinedFunctionExecution === "check availability") {
|
|
26
|
-
|
|
29
|
+
const checkPlansNode = renderCheckPlans?.({
|
|
30
|
+
ctaText: buttonLabel,
|
|
31
|
+
buttonVariant: buttonVariant,
|
|
32
|
+
showButtonAs: showButtonAs,
|
|
33
|
+
});
|
|
34
|
+
return checkPlansNode;
|
|
27
35
|
}
|
|
28
36
|
function linkClick(event: React.MouseEvent<HTMLAnchorElement>) {
|
|
37
|
+
if (clickToOpen === "modal") {
|
|
38
|
+
onModalButtonClick?.(tabmodalNameToOpen);
|
|
39
|
+
}
|
|
29
40
|
onClick?.(event);
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
function buttonClick(event: React.MouseEvent<HTMLButtonElement>) {
|
|
44
|
+
if (clickToOpen === "modal") {
|
|
45
|
+
onModalButtonClick?.(tabmodalNameToOpen);
|
|
46
|
+
}
|
|
33
47
|
onClick?.(event);
|
|
34
48
|
}
|
|
35
49
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CheckPlansProps } from "@shared/types/micro-components";
|
|
4
|
+
|
|
1
5
|
export type ButtonProps = {
|
|
2
6
|
showButtonAs?: "solid" | "text" | "unstyled";
|
|
3
7
|
buttonVariant?: "primary_brand" | "secondary" | "primary_inverse";
|
|
@@ -14,7 +18,7 @@ export type ButtonProps = {
|
|
|
14
18
|
clickToOpen?: string;
|
|
15
19
|
tabmodalNameToOpen?: string;
|
|
16
20
|
preDefinedFunctionExecution?: string;
|
|
17
|
-
|
|
21
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
18
22
|
linkClassName?: string;
|
|
19
23
|
buttonClassName?: string;
|
|
20
24
|
linkVariant?: "unstyled" | "default";
|
|
@@ -23,4 +27,5 @@ export type ButtonProps = {
|
|
|
23
27
|
event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>
|
|
24
28
|
) => void;
|
|
25
29
|
children?: React.ReactNode;
|
|
30
|
+
onModalButtonClick?: (id?: string) => void;
|
|
26
31
|
};
|
|
@@ -27,6 +27,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
27
27
|
color = "light",
|
|
28
28
|
imageWidth = 660,
|
|
29
29
|
imageHeight = 660,
|
|
30
|
+
onModalButtonClick,
|
|
30
31
|
}) => {
|
|
31
32
|
return (
|
|
32
33
|
<div className="component-container">
|
|
@@ -94,12 +95,20 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
94
95
|
<div className="flex w-full flex-col gap-8 xl:flex-row xl:gap-3">
|
|
95
96
|
{cta && (
|
|
96
97
|
<div className="primary-cta w-full xl:w-auto">
|
|
97
|
-
<Button
|
|
98
|
+
<Button
|
|
99
|
+
{...cta}
|
|
100
|
+
fullWidth={true}
|
|
101
|
+
onModalButtonClick={onModalButtonClick}
|
|
102
|
+
/>
|
|
98
103
|
</div>
|
|
99
104
|
)}
|
|
100
105
|
{secondaryCta && (
|
|
101
106
|
<div className="secondary-cta">
|
|
102
|
-
<Button
|
|
107
|
+
<Button
|
|
108
|
+
{...secondaryCta}
|
|
109
|
+
fullWidth={true}
|
|
110
|
+
onModalButtonClick={onModalButtonClick}
|
|
111
|
+
/>
|
|
103
112
|
</div>
|
|
104
113
|
)}
|
|
105
114
|
</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 ImagePromoBarProps = {
|
|
4
6
|
brow: string;
|
|
5
7
|
enableHeading: boolean;
|
|
@@ -24,4 +26,6 @@ export type ImagePromoBarProps = {
|
|
|
24
26
|
};
|
|
25
27
|
maxWidth?: boolean;
|
|
26
28
|
color: "light" | "dark";
|
|
29
|
+
onModalButtonClick?: (id?: string) => void;
|
|
30
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
27
31
|
};
|
|
@@ -19,11 +19,12 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
19
19
|
priceCallout,
|
|
20
20
|
priceSuffix,
|
|
21
21
|
checklist,
|
|
22
|
-
|
|
22
|
+
renderCheckPlans,
|
|
23
23
|
badgeImage,
|
|
24
24
|
pricingDescriptionDisclaimer,
|
|
25
25
|
secondaryCta,
|
|
26
26
|
secondaryCtaPrefix,
|
|
27
|
+
onModalButtonClick,
|
|
27
28
|
} = props;
|
|
28
29
|
|
|
29
30
|
const bottomLinkLabel = bottomLink?.buttonLabel ?? bottomLink?.label;
|
|
@@ -55,7 +56,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
55
56
|
{/* price callout */}
|
|
56
57
|
{price ? (
|
|
57
58
|
<div className="flex">
|
|
58
|
-
<div className="mr-2 mt-
|
|
59
|
+
<div className="mr-2 mt-0.5">
|
|
59
60
|
{priceCallout
|
|
60
61
|
? priceCallout.split("|").map((line, index) => (
|
|
61
62
|
<Text key={index} as="p" className="body2">
|
|
@@ -65,14 +66,14 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
65
66
|
: null}
|
|
66
67
|
</div>
|
|
67
68
|
<div className="flex">
|
|
68
|
-
<Text as="p" className="subheading1 mt-
|
|
69
|
+
<Text as="p" className="subheading1 mt-0.5">
|
|
69
70
|
$
|
|
70
71
|
</Text>
|
|
71
72
|
<Text as="p" className="subheading5">
|
|
72
73
|
{price}
|
|
73
74
|
</Text>
|
|
74
75
|
{priceSuffix ? (
|
|
75
|
-
<Text as="p" className="subheading1 mt-
|
|
76
|
+
<Text as="p" className="subheading1 mt-0.5">
|
|
76
77
|
{priceSuffix}
|
|
77
78
|
</Text>
|
|
78
79
|
) : null}
|
|
@@ -93,7 +94,11 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
93
94
|
{/* desktop CTA */}
|
|
94
95
|
{primaryCta1 && (
|
|
95
96
|
<div className={cx("hidden lg:flex lg:flex-col")}>
|
|
96
|
-
<Button
|
|
97
|
+
<Button
|
|
98
|
+
{...primaryCta1}
|
|
99
|
+
renderCheckPlans={renderCheckPlans}
|
|
100
|
+
onModalButtonClick={onModalButtonClick}
|
|
101
|
+
/>
|
|
97
102
|
</div>
|
|
98
103
|
)}
|
|
99
104
|
|
|
@@ -107,6 +112,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
107
112
|
{secondaryCta && (
|
|
108
113
|
<Button
|
|
109
114
|
linkClassName="body2 text-text-inverse"
|
|
115
|
+
onModalButtonClick={onModalButtonClick}
|
|
110
116
|
{...secondaryCta}
|
|
111
117
|
/>
|
|
112
118
|
)}
|
|
@@ -119,6 +125,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
119
125
|
<Button
|
|
120
126
|
{...bottomLink}
|
|
121
127
|
linkClassName="text-footnote text-white"
|
|
128
|
+
onModalButtonClick={onModalButtonClick}
|
|
122
129
|
/>
|
|
123
130
|
</div>
|
|
124
131
|
)}
|
|
@@ -159,7 +166,11 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
159
166
|
|
|
160
167
|
{bottomLink && (bottomLinkLabel || bottomLink?.href) && (
|
|
161
168
|
<div>
|
|
162
|
-
<Button
|
|
169
|
+
<Button
|
|
170
|
+
{...bottomLink}
|
|
171
|
+
onModalButtonClick={onModalButtonClick}
|
|
172
|
+
linkClassName="body3 text-white"
|
|
173
|
+
/>
|
|
163
174
|
</div>
|
|
164
175
|
)}
|
|
165
176
|
|
|
@@ -176,7 +187,12 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
|
|
|
176
187
|
{secondaryCtaPrefix}
|
|
177
188
|
</Text>
|
|
178
189
|
)}
|
|
179
|
-
{secondaryCta &&
|
|
190
|
+
{secondaryCta && (
|
|
191
|
+
<Button
|
|
192
|
+
{...secondaryCta}
|
|
193
|
+
onModalButtonClick={onModalButtonClick}
|
|
194
|
+
/>
|
|
195
|
+
)}
|
|
180
196
|
</div>
|
|
181
197
|
) : null}
|
|
182
198
|
</div>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CheckPlansProps } from "@shared/types/micro-components";
|
|
4
|
+
|
|
1
5
|
export type PrimaryHeroProps = {
|
|
2
6
|
title: string;
|
|
3
7
|
showAsHeading?: boolean;
|
|
@@ -26,5 +30,6 @@ export type PrimaryHeroProps = {
|
|
|
26
30
|
badgeImage?: string;
|
|
27
31
|
textColor?: string;
|
|
28
32
|
maxWidth?: boolean;
|
|
29
|
-
|
|
33
|
+
renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
|
|
34
|
+
onModalButtonClick?: (id?: string) => void;
|
|
30
35
|
};
|
|
@@ -78,3 +78,12 @@ export interface RichTextItem {
|
|
|
78
78
|
isTargetBlank?: boolean;
|
|
79
79
|
richText?: { json: any };
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
export type CheckPlansProps = {
|
|
83
|
+
className?: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
ctaAlignment?: "new-row" | "same-row";
|
|
86
|
+
ctaText?: string;
|
|
87
|
+
buttonVariant?: "primary_brand" | "secondary" | "primary_inverse";
|
|
88
|
+
showButtonAs?: "solid" | "unstyled" | "text" | undefined;
|
|
89
|
+
};
|