@windstream/react-shared-components 0.0.99 → 0.1.0
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 +49 -3
- package/dist/contentful/index.esm.js +9 -1
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +9 -1
- package/dist/contentful/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/pagination/index.tsx +100 -0
- package/src/components/pagination/types.ts +6 -0
- package/src/contentful/blocks/blogs-grid/index.tsx +129 -0
- package/src/contentful/blocks/blogs-grid/types.ts +26 -0
- package/src/contentful/blocks/button/index.tsx +2 -1
- package/src/contentful/blocks/cards/blog-card/index.tsx +99 -0
- package/src/contentful/blocks/cards/blog-card/types.ts +14 -0
- package/src/contentful/blocks/cards/product-card/index.tsx +3 -1
- package/src/contentful/blocks/find-kinetic/index.tsx +8 -2
- package/src/contentful/blocks/floating-banner/types.ts +1 -1
- package/src/contentful/index.ts +6 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BlogCardProps } from "./types";
|
|
3
|
+
import Image from "next/image";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
|
|
6
|
+
import { Button } from "@shared/components/button";
|
|
7
|
+
import { MaterialIcon } from "@shared/components/material-icon";
|
|
8
|
+
import { Text } from "@shared/components/text";
|
|
9
|
+
|
|
10
|
+
export const BlogCard: React.FC<BlogCardProps> = ({
|
|
11
|
+
href,
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
date,
|
|
15
|
+
category,
|
|
16
|
+
image,
|
|
17
|
+
readMoreText = "Read more",
|
|
18
|
+
}: BlogCardProps) => {
|
|
19
|
+
return (
|
|
20
|
+
<article className="flex flex-col overflow-hidden rounded-xl bg-white shadow-[0_1px_4px_rgba(0,0,0,0.08),0_4px_16px_rgba(0,0,0,0.06)] transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_8px_24px_rgba(0,0,0,0.10)]">
|
|
21
|
+
{/* Image */}
|
|
22
|
+
<Link href={href} tabIndex={-1} aria-hidden="true" className="block">
|
|
23
|
+
<div className="aspect-video w-full flex-shrink-0 overflow-hidden bg-gray-100">
|
|
24
|
+
{image ? (
|
|
25
|
+
<Image
|
|
26
|
+
src={image.src}
|
|
27
|
+
alt={image.alt}
|
|
28
|
+
width={image.width}
|
|
29
|
+
height={image.height}
|
|
30
|
+
className="h-full w-full object-cover transition-transform duration-300 hover:scale-[1.03]"
|
|
31
|
+
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
|
32
|
+
/>
|
|
33
|
+
) : (
|
|
34
|
+
<div
|
|
35
|
+
className="h-full w-full bg-gradient-to-br from-gray-200 to-gray-100"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
/>
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
</Link>
|
|
41
|
+
|
|
42
|
+
{/* Body */}
|
|
43
|
+
<div className="flex flex-1 flex-col gap-5 p-5 pb-6">
|
|
44
|
+
{/* Meta: category + date */}
|
|
45
|
+
<div className="flex items-center gap-2 text-[13px]">
|
|
46
|
+
<span className="text-body2 font-semibold text-text-brand">
|
|
47
|
+
{category}
|
|
48
|
+
</span>
|
|
49
|
+
{date && (
|
|
50
|
+
<>
|
|
51
|
+
<span className="text-xs text-text" aria-hidden="true">
|
|
52
|
+
•
|
|
53
|
+
</span>
|
|
54
|
+
<time className="text-body2 text-text">{date}</time>
|
|
55
|
+
</>
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
{/* Title */}
|
|
60
|
+
{title && (
|
|
61
|
+
<Link
|
|
62
|
+
href={href}
|
|
63
|
+
className="m-0 line-clamp-3 text-heading6 font-black transition-colors duration-150 hover:text-text-brand"
|
|
64
|
+
>
|
|
65
|
+
{title}
|
|
66
|
+
</Link>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{/* Excerpt */}
|
|
70
|
+
{description && (
|
|
71
|
+
<Text className="m-0 line-clamp-3 flex-1 text-body1">
|
|
72
|
+
{description}
|
|
73
|
+
</Text>
|
|
74
|
+
)}
|
|
75
|
+
|
|
76
|
+
{/* Read more */}
|
|
77
|
+
<Link
|
|
78
|
+
href={href}
|
|
79
|
+
className="group mt-auto inline-flex justify-between pt-3 text-sm text-text-brand no-underline transition-all duration-200 hover:gap-2.5 hover:text-[#007ab8]"
|
|
80
|
+
aria-label={`${readMoreText} about ${title || "this article"}`}
|
|
81
|
+
>
|
|
82
|
+
<Button
|
|
83
|
+
aria-label={`${readMoreText} about ${title || "this article"}`}
|
|
84
|
+
className="flex w-36 justify-around text-nowrap text-label1 font-black"
|
|
85
|
+
>
|
|
86
|
+
{readMoreText}
|
|
87
|
+
<MaterialIcon
|
|
88
|
+
name="expand_circle_right"
|
|
89
|
+
fill={0}
|
|
90
|
+
size={24}
|
|
91
|
+
weight="600"
|
|
92
|
+
/>
|
|
93
|
+
</Button>
|
|
94
|
+
</Link>
|
|
95
|
+
</div>
|
|
96
|
+
</article>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
export default BlogCard;
|
|
@@ -123,7 +123,9 @@ export const ProductCard: React.FC<ProductCardProps> = ({
|
|
|
123
123
|
width={24}
|
|
124
124
|
height={24}
|
|
125
125
|
/>
|
|
126
|
-
<Text as="div" className="text-sm font-bold">
|
|
126
|
+
<Text as="div" className="text-sm font-bold">
|
|
127
|
+
{badge.title}
|
|
128
|
+
</Text>
|
|
127
129
|
</div>
|
|
128
130
|
);
|
|
129
131
|
})}
|
|
@@ -75,7 +75,10 @@ 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
|
|
78
|
+
<Link
|
|
79
|
+
href={`/local/${item.code.toLowerCase()}`}
|
|
80
|
+
className="label1"
|
|
81
|
+
>
|
|
79
82
|
{item.name}
|
|
80
83
|
</Link>
|
|
81
84
|
</li>
|
|
@@ -100,7 +103,10 @@ export const FindKinetic: React.FC<FindKineticProps> = ({
|
|
|
100
103
|
}
|
|
101
104
|
return rearranged.map((item, index: number) => (
|
|
102
105
|
<li key={`item-list-3-${index}`}>
|
|
103
|
-
<Link
|
|
106
|
+
<Link
|
|
107
|
+
href={`/local/${item.code.toLowerCase()}`}
|
|
108
|
+
className="label1"
|
|
109
|
+
>
|
|
104
110
|
{item.name}
|
|
105
111
|
</Link>
|
|
106
112
|
</li>
|
|
@@ -8,7 +8,7 @@ export type FloatingBannerProps = {
|
|
|
8
8
|
description?: React.ReactNode;
|
|
9
9
|
cta?: any | null;
|
|
10
10
|
disclaimer?: React.ReactNode;
|
|
11
|
-
background?: "green" | "navy" | "white";
|
|
11
|
+
background?: "green" | "navy" | "white" | "purple" | "blue" | "yellow";
|
|
12
12
|
color?: "dark" | "light";
|
|
13
13
|
maxWidth?: boolean;
|
|
14
14
|
};
|
package/src/contentful/index.ts
CHANGED
|
@@ -55,3 +55,9 @@ export type { TestimonialCardProps } from "./blocks/cards/testimonial-card/types
|
|
|
55
55
|
|
|
56
56
|
export { ProductCard } from "./blocks/cards/product-card";
|
|
57
57
|
export type { ProductCardProps } from "./blocks/cards/product-card/types";
|
|
58
|
+
|
|
59
|
+
export { BlogCard } from "./blocks/cards/blog-card";
|
|
60
|
+
export type { BlogCardProps } from "./blocks/cards/blog-card/types";
|
|
61
|
+
|
|
62
|
+
export { BlogGrid } from "./blocks/blogs-grid";
|
|
63
|
+
export type { BlogGridProps } from "./blocks/blogs-grid/types";
|