@windstream/react-shared-components 0.1.78 → 0.1.80

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.
@@ -0,0 +1,144 @@
1
+ import { BlogCardProps, BlogCategoryOption } from "./types";
2
+
3
+ /* ----------------------
4
+ CATEGORY OPTIONS
5
+ ------------------------- */
6
+
7
+ export const CATEGORY_OPTIONS: BlogCategoryOption[] = [
8
+ { value: "all", label: "All Categories" },
9
+ { value: "technology", label: "Technology" },
10
+ { value: "business", label: "Business" },
11
+ { value: "lifestyle", label: "Lifestyle" },
12
+ { value: "entertainment", label: "Entertainment" },
13
+ ];
14
+
15
+ /* ----------------------
16
+ ARTICLES WITH COVERS (6)
17
+ ------------------------- */
18
+
19
+ export const ARTICLES_WITH_COVERS: BlogCardProps[] = [
20
+ {
21
+ slug: "blog/getting-started-with-fiber",
22
+ title: "Getting Started with Fiber Internet",
23
+ shortDescription:
24
+ "Everything you need to know about making the switch to fiber optic internet for your home.",
25
+ blogCreationDate: "2025-12-01",
26
+ category: "Technology",
27
+ cover: {
28
+ url: "https://placehold.co/600x338/0ea5e9/ffffff?text=Fiber+Internet",
29
+ width: 600,
30
+ height: 338,
31
+ title: "Fiber internet illustration",
32
+ },
33
+ },
34
+ {
35
+ slug: "blog/smart-home-tips",
36
+ title: "10 Smart Home Tips for Beginners",
37
+ shortDescription:
38
+ "Transform your living space with these easy smart-home upgrades that anyone can do.",
39
+ blogCreationDate: "2025-11-18",
40
+ category: "Technology",
41
+ cover: {
42
+ url: "https://placehold.co/600x338/8b5cf6/ffffff?text=Smart+Home",
43
+ width: 600,
44
+ height: 338,
45
+ title: "Smart home devices",
46
+ },
47
+ },
48
+ {
49
+ slug: "blog/remote-work-connectivity",
50
+ title: "Stay Connected While Working Remotely",
51
+ shortDescription:
52
+ "Best practices for maintaining a rock-solid internet connection in your home office.",
53
+ blogCreationDate: "2025-11-05",
54
+ category: "Business",
55
+ cover: {
56
+ url: "https://placehold.co/600x338/f59e0b/ffffff?text=Remote+Work",
57
+ width: 600,
58
+ height: 338,
59
+ title: "Remote work setup",
60
+ },
61
+ },
62
+ {
63
+ slug: "blog/streaming-quality-guide",
64
+ title: "The Ultimate Streaming Quality Guide",
65
+ shortDescription:
66
+ "How to get the best picture and sound from your favorite streaming services.",
67
+ blogCreationDate: "2025-10-22",
68
+ category: "Entertainment",
69
+ cover: {
70
+ url: "https://placehold.co/600x338/ec4899/ffffff?text=Streaming",
71
+ width: 600,
72
+ height: 338,
73
+ title: "Streaming setup",
74
+ },
75
+ },
76
+ {
77
+ slug: "blog/digital-wellness",
78
+ title: "Digital Wellness: Finding Balance Online",
79
+ shortDescription:
80
+ "Practical strategies for maintaining a healthy relationship with technology.",
81
+ blogCreationDate: "2025-10-10",
82
+ category: "Lifestyle",
83
+ cover: {
84
+ url: "https://placehold.co/600x338/10b981/ffffff?text=Digital+Wellness",
85
+ width: 600,
86
+ height: 338,
87
+ title: "Digital wellness",
88
+ },
89
+ },
90
+ {
91
+ slug: "blog/cybersecurity-basics",
92
+ title: "Cybersecurity Basics for Every Household",
93
+ shortDescription:
94
+ "Simple steps to protect your family's data and devices from online threats.",
95
+ blogCreationDate: "2025-09-28",
96
+ category: "Technology",
97
+ cover: {
98
+ url: "https://placehold.co/600x338/ef4444/ffffff?text=Cybersecurity",
99
+ width: 600,
100
+ height: 338,
101
+ title: "Cybersecurity basics",
102
+ },
103
+ },
104
+ ];
105
+
106
+ /* ----------------------
107
+ ARTICLES WITHOUT COVERS (3)
108
+ ------------------------- */
109
+
110
+ export const ARTICLES_WITHOUT_COVERS: BlogCardProps[] = [
111
+ {
112
+ slug: "blog/home-network-setup",
113
+ title: "How to Set Up Your Home Network Like a Pro",
114
+ shortDescription:
115
+ "A step-by-step guide to configuring routers, extenders, and mesh systems.",
116
+ blogCreationDate: "2025-09-15",
117
+ category: "Technology",
118
+ },
119
+ {
120
+ slug: "blog/budgeting-internet-plan",
121
+ title: "Choosing the Right Internet Plan on a Budget",
122
+ shortDescription:
123
+ "Compare plans and find the best value for your household's internet needs.",
124
+ blogCreationDate: "2025-09-01",
125
+ category: "Business",
126
+ },
127
+ {
128
+ slug: "blog/gaming-online",
129
+ title: "Level Up Your Online Gaming Experience",
130
+ shortDescription:
131
+ "Reduce lag, improve ping, and get the most out of competitive online gaming.",
132
+ blogCreationDate: "2025-08-20",
133
+ category: "Entertainment",
134
+ },
135
+ ];
136
+
137
+ /* ----------------------
138
+ COMBINED (all 9 articles)
139
+ ------------------------- */
140
+
141
+ export const ALL_ARTICLES: BlogCardProps[] = [
142
+ ...ARTICLES_WITH_COVERS,
143
+ ...ARTICLES_WITHOUT_COVERS,
144
+ ];
@@ -0,0 +1,156 @@
1
+ import {
2
+ ALL_ARTICLES,
3
+ ARTICLES_WITH_COVERS,
4
+ ARTICLES_WITHOUT_COVERS,
5
+ CATEGORY_OPTIONS,
6
+ } from "./BlogGrid.stories.mocks";
7
+ import { BlogGrid } from "./index";
8
+ import type { BlogGridProps } from "./types";
9
+
10
+ import { DocsPage } from "@shared/stories/DocsTemplate";
11
+ import type { ArgTypes, Meta, StoryObj } from "@storybook/react";
12
+
13
+ /* ------------
14
+ ArgTypes
15
+ --------------- */
16
+
17
+ const argTypes: ArgTypes<BlogGridProps> = {
18
+ paginatedArticles: {
19
+ control: { type: "object" as const },
20
+ description: "Array of blog articles to display on the current page",
21
+ },
22
+ totalArticles: {
23
+ control: { type: "number" as const },
24
+ description: "Total number of articles across all pages",
25
+ },
26
+ currentPage: {
27
+ control: { type: "number" as const },
28
+ description: "Current active page number",
29
+ },
30
+ totalPages: {
31
+ control: { type: "number" as const },
32
+ description: "Total number of pages",
33
+ },
34
+ selectedCategory: {
35
+ control: { type: "object" as const },
36
+ description: "Currently selected category option",
37
+ },
38
+ categoryOptions: {
39
+ control: { type: "object" as const },
40
+ description: "Available category filter options",
41
+ },
42
+ };
43
+
44
+ /* --------
45
+ Meta
46
+ ----------- */
47
+
48
+ const meta: Meta<typeof BlogGrid> = {
49
+ title: "Contentful Blocks/BlogGrid",
50
+ component: BlogGrid,
51
+ tags: ["autodocs"],
52
+ argTypes,
53
+ parameters: {
54
+ layout: "fullscreen",
55
+ docs: {
56
+ page: DocsPage,
57
+ description: {
58
+ component:
59
+ "A paginated, filterable grid of blog article cards with a category dropdown, article count summary, and pagination controls.",
60
+ },
61
+ },
62
+ },
63
+ args: {
64
+ paginatedArticles: ARTICLES_WITH_COVERS,
65
+ totalArticles: ALL_ARTICLES.length,
66
+ currentPage: 1,
67
+ totalPages: 2,
68
+ selectedCategory: CATEGORY_OPTIONS[0],
69
+ categoryOptions: CATEGORY_OPTIONS,
70
+ },
71
+ };
72
+
73
+ export default meta;
74
+ type Story = StoryObj<typeof meta>;
75
+
76
+ /* --------
77
+ Stories
78
+ ----------- */
79
+
80
+ export const Default: Story = {};
81
+
82
+ export const WithPagination: Story = {
83
+ args: {
84
+ paginatedArticles: ARTICLES_WITH_COVERS,
85
+ totalArticles: 18,
86
+ currentPage: 2,
87
+ totalPages: 3,
88
+ },
89
+ };
90
+
91
+ export const SinglePage: Story = {
92
+ args: {
93
+ paginatedArticles: ARTICLES_WITH_COVERS,
94
+ totalArticles: 6,
95
+ currentPage: 1,
96
+ totalPages: 1,
97
+ },
98
+ };
99
+
100
+ export const EmptyState: Story = {
101
+ args: {
102
+ paginatedArticles: [],
103
+ totalArticles: 9,
104
+ currentPage: 1,
105
+ totalPages: 1,
106
+ selectedCategory: CATEGORY_OPTIONS[1],
107
+ },
108
+ };
109
+
110
+ export const CategoryFilterActive: Story = {
111
+ args: {
112
+ paginatedArticles: ALL_ARTICLES.filter(
113
+ (a) => a.category === "Technology",
114
+ ),
115
+ totalArticles: 4,
116
+ currentPage: 1,
117
+ totalPages: 1,
118
+ selectedCategory: CATEGORY_OPTIONS[1],
119
+ },
120
+ };
121
+
122
+ export const WithCoverImages: Story = {
123
+ args: {
124
+ paginatedArticles: ARTICLES_WITH_COVERS,
125
+ totalArticles: 6,
126
+ currentPage: 1,
127
+ totalPages: 1,
128
+ },
129
+ };
130
+
131
+ export const WithoutCoverImages: Story = {
132
+ args: {
133
+ paginatedArticles: ARTICLES_WITHOUT_COVERS,
134
+ totalArticles: 3,
135
+ currentPage: 1,
136
+ totalPages: 1,
137
+ },
138
+ };
139
+
140
+ export const MixedCoverImages: Story = {
141
+ args: {
142
+ paginatedArticles: [...ARTICLES_WITH_COVERS.slice(4), ...ARTICLES_WITHOUT_COVERS],
143
+ totalArticles: 5,
144
+ currentPage: 1,
145
+ totalPages: 1,
146
+ },
147
+ };
148
+
149
+ export const SingleArticle: Story = {
150
+ args: {
151
+ paginatedArticles: [ARTICLES_WITH_COVERS[0]],
152
+ totalArticles: 1,
153
+ currentPage: 1,
154
+ totalPages: 1,
155
+ },
156
+ };
@@ -0,0 +1,147 @@
1
+ import { BreadcrumbNavigation } from "./index";
2
+
3
+ import { DocsPage } from "@shared/stories/DocsTemplate";
4
+ import type { Meta, StoryObj } from "@storybook/react";
5
+
6
+ const meta: Meta<typeof BreadcrumbNavigation> = {
7
+ title: "Contentful Blocks/Breadcrumb",
8
+ component: BreadcrumbNavigation,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "fullscreen",
12
+ docs: {
13
+ page: DocsPage,
14
+ description: {
15
+ component:
16
+ "Breadcrumb navigation component used to display the user's location within the site hierarchy.",
17
+ },
18
+ },
19
+ },
20
+ args: {
21
+ textColor: "dark",
22
+ mobileTextColor: undefined,
23
+ desktopTextColor: undefined,
24
+ maxWidth: true,
25
+ float: "desktop",
26
+ links: [
27
+ { buttonLabel: "Home", href: "/" },
28
+ { buttonLabel: "Category", href: "/category" },
29
+ { buttonLabel: "Current Page" },
30
+ ],
31
+ },
32
+ argTypes: {
33
+ links: { control: "object" },
34
+ textColor: {
35
+ control: "radio",
36
+ options: ["dark", "light"],
37
+ },
38
+ mobileTextColor: {
39
+ control: "radio",
40
+ options: ["dark", "light"],
41
+ },
42
+ desktopTextColor: {
43
+ control: "radio",
44
+ options: ["dark", "light"],
45
+ },
46
+ maxWidth: { control: "boolean" },
47
+ float: {
48
+ control: "radio",
49
+ options: ["none", "mobile", "desktop", "always"],
50
+ },
51
+ },
52
+ };
53
+
54
+ export default meta;
55
+ type Story = StoryObj<typeof meta>;
56
+
57
+ /* ---------------- Stories ---------------- */
58
+
59
+ export const Default: Story = {};
60
+
61
+ export const LightText: Story = {
62
+ args: {
63
+ textColor: "light",
64
+ },
65
+ parameters: {
66
+ backgrounds: {
67
+ default: "dark",
68
+ },
69
+ },
70
+ };
71
+
72
+ export const WithImages: Story = {
73
+ args: {
74
+ links: [
75
+ {
76
+ buttonLabel: "Home",
77
+ href: "/",
78
+
79
+ image: {
80
+ url: "https://images.ctfassets.net/8d4yn2ywtegc/50Aef1sWZhzXKR0smBjFi8/e552eb0193b203822381f508babd51b3/Alabama.svg",
81
+ alt: "Home",
82
+ },
83
+ },
84
+ {
85
+ buttonLabel: "Category",
86
+ href: "/category",
87
+
88
+ image: {
89
+ url: "https://images.ctfassets.net/8d4yn2ywtegc/50Aef1sWZhzXKR0smBjFi8/e552eb0193b203822381f508babd51b3/Alabama.svg",
90
+ alt: "Category",
91
+ },
92
+ },
93
+ {
94
+ buttonLabel: "Current Page",
95
+ },
96
+ ],
97
+ },
98
+ };
99
+
100
+ export const SingleLink: Story = {
101
+ args: {
102
+ links: [{ buttonLabel: "Current Page" }],
103
+ },
104
+ };
105
+
106
+ export const EmptyLinks: Story = {
107
+ args: {
108
+ links: [],
109
+ },
110
+ };
111
+
112
+ export const FloatOnMobile: Story = {
113
+ args: {
114
+ float: "mobile",
115
+ },
116
+ };
117
+
118
+ export const FloatOnDesktop: Story = {
119
+ args: {
120
+ float: "desktop",
121
+ },
122
+ };
123
+
124
+ export const FloatAlways: Story = {
125
+ args: {
126
+ float: "always",
127
+ },
128
+ };
129
+
130
+ export const MaxWidthDisabled: Story = {
131
+ args: {
132
+ maxWidth: false,
133
+ },
134
+ };
135
+
136
+ export const MixedTextColors: Story = {
137
+ args: {
138
+ mobileTextColor: "light",
139
+ desktopTextColor: "dark",
140
+ float: "mobile",
141
+ },
142
+ parameters: {
143
+ backgrounds: {
144
+ default: "dark",
145
+ },
146
+ },
147
+ };
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import Button from "../button";
3
2
  import { BreadcrumbNavigationProps } from "./types";
4
3
 
5
4
  import { MaterialIcon } from "@shared/components/material-icon";
@@ -11,24 +10,37 @@ export const BreadcrumbNavigation: React.FC<
11
10
  const {
12
11
  links = [],
13
12
  textColor = "dark",
13
+ mobileTextColor,
14
+ desktopTextColor,
14
15
  maxWidth = true,
15
- floatOnMobile = false,
16
+ float = "desktop",
16
17
  } = props;
17
- const color = floatOnMobile
18
- ? textColor === "dark"
19
- ? "text-text"
20
- : "text-white"
21
- : textColor === "dark"
22
- ? "text-white xl:text-text"
23
- : "text-text xl:text-white";
18
+ const resolvedMobile =
19
+ mobileTextColor ?? (float === "desktop" ? "dark" : textColor);
20
+ const resolvedDesktop =
21
+ desktopTextColor ?? (float === "mobile" ? "dark" : textColor);
22
+ const mobileColor = resolvedMobile === "dark" ? "text-text" : "text-white";
23
+ const desktopColor =
24
+ resolvedDesktop === "dark" ? "xl:text-text" : "xl:text-white";
25
+ const color = `${mobileColor} ${desktopColor}`;
26
+
27
+ const olPosition =
28
+ float === "always"
29
+ ? "absolute"
30
+ : float === "mobile"
31
+ ? "absolute xl:relative"
32
+ : float === "desktop"
33
+ ? "relative xl:absolute"
34
+ : "relative";
35
+
24
36
  if (!links.length) return null;
25
37
  return (
26
38
  <nav
27
39
  aria-label="Breadcrumb"
28
- className={`${maxWidth ? `${!floatOnMobile && "mx-5"} max-w-120 xl:mx-auto` : "mx-auto"} relative`}
40
+ className={`${maxWidth ? `${float === "none" && "mx-5"} max-w-120 xl:mx-auto` : "mx-auto"} relative`}
29
41
  >
30
42
  <ol
31
- className={`right-0 z-10 mx-0 flex w-full flex-nowrap items-center gap-2 px-7 pb-0 pt-8 md:px-14 ${floatOnMobile ? "absolute" : "relative xl:absolute"} xl:mx-auto xl:flex-wrap xl:px-3`}
43
+ className={`right-0 z-10 mx-0 flex w-full flex-nowrap items-center gap-2 px-7 pb-0 pt-8 md:px-14 ${olPosition} xl:mx-auto xl:flex-wrap xl:px-3`}
32
44
  >
33
45
  {links.map((link, index) => {
34
46
  const { image, ...linkProps } = link;
@@ -49,11 +61,13 @@ export const BreadcrumbNavigation: React.FC<
49
61
  className="mr-2 h-10 w-10"
50
62
  />
51
63
  )}
52
- <Button
53
- {...linkProps}
54
- linkClassName={`label3 mr-2 whitespace-nowrap ${color}`}
55
- linkVariant="unstyled"
56
- />
64
+ <a
65
+ href={linkProps.href}
66
+ className={`label3 mr-2 whitespace-nowrap ${color} hover:underline`}
67
+ >
68
+ {linkProps.buttonLabel}
69
+ </a>
70
+
57
71
  <MaterialIcon name="chevron_right" className={`${color} `} />
58
72
  </li>
59
73
  ) : (
@@ -1,6 +1,8 @@
1
1
  export type BreadcrumbNavigationProps = {
2
2
  links?: Array<any>;
3
3
  textColor?: "dark" | "light";
4
+ mobileTextColor?: "dark" | "light";
5
+ desktopTextColor?: "dark" | "light";
4
6
  maxWidth?: boolean;
5
- floatOnMobile?: boolean;
7
+ float?: "none" | "mobile" | "desktop" | "always";
6
8
  };
@@ -169,7 +169,7 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
169
169
  return (
170
170
  <section
171
171
  className={cx(
172
- "callout-card relative flex w-full flex-col rounded-3xl p-0",
172
+ "callout-card relative flex h-full w-full flex-col rounded-3xl p-0",
173
173
  card.shadow && "shadow-card",
174
174
  card.image && !fullSizeImage && !card.showBackgroundImage && "pt-1",
175
175
  !card.applyCardBackgroundColor &&