@windstream/react-shared-components 0.1.96 → 0.1.98

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.
Files changed (34) hide show
  1. package/dist/contentful/index.d.ts +5 -0
  2. package/dist/contentful/index.esm.js +2 -2
  3. package/dist/contentful/index.esm.js.map +1 -1
  4. package/dist/contentful/index.js +2 -2
  5. package/dist/contentful/index.js.map +1 -1
  6. package/dist/core.d.ts +2 -2
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.esm.js +1 -1
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/next/index.esm.js.map +1 -1
  13. package/dist/next/index.js.map +1 -1
  14. package/dist/styles.css +1 -1
  15. package/dist/utils/index.esm.js +1 -1
  16. package/dist/utils/index.esm.js.map +1 -1
  17. package/dist/utils/index.js +1 -1
  18. package/dist/utils/index.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/components/animation-wrapper/index.tsx +5 -0
  21. package/src/components/animation-wrapper/types.ts +7 -1
  22. package/src/components/brand-button/index.tsx +1 -1
  23. package/src/contentful/blocks/breadcrumbs/index.tsx +2 -2
  24. package/src/contentful/blocks/button/index.tsx +24 -3
  25. package/src/contentful/blocks/button/types.ts +1 -0
  26. package/src/contentful/blocks/email-input-block/index.tsx +16 -7
  27. package/src/contentful/blocks/find-kinetic/index.tsx +61 -35
  28. package/src/contentful/blocks/find-kinetic/types.ts +1 -0
  29. package/src/contentful/blocks/image-promo-bar/helper.tsx +1 -1
  30. package/src/contentful/blocks/image-promo-bar/index.tsx +38 -10
  31. package/src/contentful/blocks/image-promo-bar/types.ts +3 -0
  32. package/src/contentful/blocks/image-promo-bar/youtube-embed.tsx +1 -1
  33. package/src/contentful/blocks/shape-background-wrapper/index.tsx +5 -2
  34. package/src/hooks/contentful/use-contentful-rich-text.tsx +6 -2
@@ -17,7 +17,7 @@ export const PlayButton: React.FC<PlayButtonProps> = ({
17
17
  name="play_arrow"
18
18
  size={72 as any}
19
19
  fill={1}
20
- className={`transition-colors duration-300 ${
20
+ className={`max-w-[72px] transition-colors duration-300 ${
21
21
  isOuterHovered
22
22
  ? "text-text-brand"
23
23
  : "text-slate-500 group-hover:text-text-brand"
@@ -31,7 +31,10 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
31
31
  color = "light",
32
32
  imageWidth = 660,
33
33
  imageHeight = 660,
34
+ useOriginalImageAspectRatio = false,
35
+ isAboveTheFold = false,
34
36
  onModalButtonClick,
37
+ onClick,
35
38
  renderCheckPlans,
36
39
  }) => {
37
40
  const [activeVideo, setActiveVideo] = useState("");
@@ -61,9 +64,9 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
61
64
  const contentVideo = videoLink && videoImage ? embedSelector() : null;
62
65
 
63
66
  return (
64
- <div className="component-container shared-component-ipb">
67
+ <div className="component-container shared-component-ipb pb-16 pt-16">
65
68
  <div
66
- className={`image-promo-bar-content ${maxWidth ? "max-w-120 xl:mx-auto" : ""} mx-5 mb-8 mt-16 md:mx-10`}
69
+ className={`image-promo-bar-content ${maxWidth ? "max-w-120 xl:mx-auto" : ""} px-5 pb-8 pt-8 md:px-10`}
67
70
  >
68
71
  <div
69
72
  className={`flex shrink-0 flex-col items-center gap-8 xl:items-stretch xl:gap-10 xl:gap-[126px] ${mediaPosition ? "xl:flex-row-reverse" : "xl:flex-row"}`}
@@ -113,6 +116,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
113
116
  listContainerClassName="mt-0 space-y-0 flex flex-col gap-3"
114
117
  />
115
118
  )}
119
+ {ctaDisclaimer && <div>{ctaDisclaimer}</div>}
116
120
  {imageLinks.length > 0 && (
117
121
  <div className="flex gap-4">
118
122
  {/* Image Links Collection */}
@@ -143,6 +147,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
143
147
  size={{ base: "large" }}
144
148
  renderCheckPlans={renderCheckPlans}
145
149
  onModalButtonClick={onModalButtonClick}
150
+ onClick={(e: React.MouseEvent) => onClick?.(e, "primary")}
146
151
  />
147
152
  </div>
148
153
  )}
@@ -154,23 +159,42 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
154
159
  size={{ base: "large" }}
155
160
  renderCheckPlans={renderCheckPlans}
156
161
  onModalButtonClick={onModalButtonClick}
162
+ onClick={(e: React.MouseEvent) =>
163
+ onClick?.(e, "secondary")
164
+ }
157
165
  />
158
166
  </div>
159
167
  )}
160
168
  </div>
161
169
  )}
162
- {ctaDisclaimer && <div>{ctaDisclaimer}</div>}
163
170
  </div>
164
- <aside className="flex w-full shrink-0 items-center justify-center lg:w-auto">
171
+ <aside className="flex w-full flex-1 shrink-0 items-center justify-center lg:w-auto">
165
172
  {/* Media Section */}
166
173
  {image && (
167
- <div className="relative h-[334px] w-[334px] overflow-hidden rounded-image md:h-[486px] md:w-[486px]">
174
+ <div
175
+ className={cx(
176
+ !useOriginalImageAspectRatio
177
+ ? "relative aspect-[16/9] w-full overflow-hidden rounded-image lg:h-[486px] xl:aspect-square xl:max-h-[486px] xl:w-[486px]"
178
+ : "overflow-hidden rounded-image"
179
+ )}
180
+ >
168
181
  <NextImage
169
182
  src={image}
170
183
  alt="section-image"
171
- fill={true}
172
- sizes="(min-width: 768px) 486px, 334px"
173
- className="object-cover"
184
+ priority={isAboveTheFold}
185
+ fill={!useOriginalImageAspectRatio}
186
+ width={
187
+ !useOriginalImageAspectRatio ? undefined : imageWidth || 660
188
+ }
189
+ height={
190
+ !useOriginalImageAspectRatio
191
+ ? undefined
192
+ : imageHeight || 660
193
+ }
194
+ sizes="(max-width: 430px) 100vw, (max-width: 834px) 100vw, 50vw"
195
+ className={cx(
196
+ !useOriginalImageAspectRatio ? "object-cover" : "w-full"
197
+ )}
174
198
  />
175
199
  </div>
176
200
  )}
@@ -212,7 +236,9 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
212
236
  <div
213
237
  className={cx(
214
238
  "aspect-[16/9] w-full overflow-hidden rounded-image transition-opacity duration-300",
215
- isPlaying ? "opacity-100" : "opacity-0"
239
+ isPlaying ? "opacity-100" : "opacity-0",
240
+ !useOriginalImageAspectRatio &&
241
+ "xl:aspect-square xl:max-h-[486px] xl:w-[486px]"
216
242
  )}
217
243
  >
218
244
  {contentVideo}
@@ -239,7 +265,9 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
239
265
  </div>
240
266
  )}
241
267
  {disclaimer && (
242
- <div className="mt-10 flex justify-center xl:mt-18">{disclaimer}</div>
268
+ <div className="mt-10 flex justify-center xl:mt-18">
269
+ <div>{disclaimer}</div>
270
+ </div>
243
271
  )}
244
272
  </div>
245
273
  );
@@ -22,6 +22,8 @@ export type ImagePromoBarProps = {
22
22
  image: string;
23
23
  imageWidth: number;
24
24
  imageHeight: number;
25
+ useOriginalImageAspectRatio?: boolean;
26
+ isAboveTheFold?: boolean;
25
27
  mediaPosition: boolean;
26
28
  description: React.ReactNode;
27
29
  openDescriptionLinksOnANewTab: boolean;
@@ -35,6 +37,7 @@ export type ImagePromoBarProps = {
35
37
  maxWidth?: boolean;
36
38
  color: "light" | "dark";
37
39
  onModalButtonClick?: (id?: string) => void;
40
+ onClick?: (event: React.MouseEvent, source: "primary" | "secondary") => void;
38
41
  renderCheckPlans?: (overrides?: CheckPlansProps) => React.ReactNode;
39
42
  };
40
43
 
@@ -30,7 +30,7 @@ export const YoutubeEmbed: React.FC<Props> = props => {
30
30
  return (
31
31
  <div
32
32
  className={cx(
33
- "relative h-0 w-full overflow-hidden pb-[56.25%]",
33
+ "relative h-full w-full overflow-hidden pb-[56.25%]",
34
34
  containerClassName
35
35
  )}
36
36
  >
@@ -46,7 +46,10 @@ export const ShapeBackgroundWrapper: React.FC<ShapeBackgroundWrapperProps> = ({
46
46
 
47
47
  if (!show) {
48
48
  return (
49
- <div className={className} style={bgStyle}>
49
+ <div
50
+ className={`shared-component-backgound-wrapper ${className ?? ""} ${bgClass ?? ""}`}
51
+ style={bgStyle}
52
+ >
50
53
  {children}
51
54
  </div>
52
55
  );
@@ -54,7 +57,7 @@ export const ShapeBackgroundWrapper: React.FC<ShapeBackgroundWrapperProps> = ({
54
57
 
55
58
  return (
56
59
  <div
57
- className={`shape-bg relative overflow-hidden ${className ?? ""} ${maxFit ? "max-content" : ""} ${
60
+ className={`shared-component-backgound-wrapper shape-bg relative overflow-hidden ${className ?? ""} ${maxFit ? "max-content" : ""} ${
58
61
  bgClass ?? (!bgStyle ? "bg-white" : "")
59
62
  }`}
60
63
  style={bgStyle}
@@ -60,8 +60,12 @@ const defaultOptions: Options = {
60
60
  </Text>
61
61
  ),
62
62
  [BLOCKS.QUOTE]: (_node, children) => <blockquote>{children}</blockquote>,
63
- [BLOCKS.UL_LIST]: (_node, children) => <ul>{children}</ul>,
64
- [BLOCKS.OL_LIST]: (_node, children) => <ol>{children}</ol>,
63
+ [BLOCKS.UL_LIST]: (_node, children) => (
64
+ <ul className="list-disc pl-6">{children}</ul>
65
+ ),
66
+ [BLOCKS.OL_LIST]: (_node, children) => (
67
+ <ol className="list-decimal pl-6">{children}</ol>
68
+ ),
65
69
  [BLOCKS.LIST_ITEM]: (_node, children) => <li>{children}</li>,
66
70
 
67
71
  [INLINES.HYPERLINK]: (node, children) => {