@windstream/react-shared-components 0.1.56 → 0.1.58

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.
@@ -1,76 +1,81 @@
1
- import React from "react";
2
- import Button from "../button";
3
- import { BreadcrumbNavigationProps } from "./types";
4
-
5
- import { MaterialIcon } from "@shared/components/material-icon";
6
- import { NextImage } from "@shared/components/next-image";
7
- import { Text } from "@shared/components/text";
8
-
9
- export const BreadcrumbNavigation: React.FC<
10
- BreadcrumbNavigationProps
11
- > = props => {
12
- const { links = [], textColor = "dark", maxWidth = true } = props;
13
- const color =
14
- textColor === "dark"
15
- ? "text-white xl:text-text"
16
- : "text-text xl:text-white";
17
- if (!links.length) return null;
18
- return (
19
- <nav
20
- aria-label="Breadcrumb"
21
- className={`${maxWidth ? "mx-5 max-w-120 xl:mx-auto" : "mx-auto"} relative`}
22
- >
23
- <ol
24
- className={
25
- "relative right-0 z-10 mx-0 flex w-full flex-nowrap items-center gap-2 px-7 pb-0 pt-8 md:px-14 xl:absolute xl:mx-auto xl:flex-wrap xl:px-3"
26
- }
27
- >
28
- {links.map((link, index) => {
29
- const { image, ...linkProps } = link;
30
- const imageSrc = image?.url
31
- ? image.url.startsWith("//")
32
- ? `https:${image.url}`
33
- : image.url
34
- : "";
35
- const isLast = index === links.length - 1;
36
- return !isLast ? (
37
- <li key={index} className="flex flex-none items-center">
38
- {imageSrc && (
39
- <NextImage
40
- src={imageSrc}
41
- alt={image?.alt || ""}
42
- width={20}
43
- height={20}
44
- className="mr-2"
45
- />
46
- )}
47
- <Button
48
- {...linkProps}
49
- linkClassName={`label3 mr-2 whitespace-nowrap ${color}`}
50
- linkVariant="unstyled"
51
- />
52
- <MaterialIcon name="chevron_right" className={`${color} `} />
53
- </li>
54
- ) : (
55
- <li key={index} className="flex min-w-0 items-center">
56
- {imageSrc && (
57
- <NextImage
58
- src={imageSrc}
59
- alt={image?.alt || ""}
60
- width={20}
61
- height={20}
62
- className="mr-2"
63
- />
64
- )}
65
- <Text as="span" className={`body3 mr-2 break-words ${color}`}>
66
- {link.buttonLabel}
67
- </Text>
68
- </li>
69
- );
70
- })}
71
- </ol>
72
- </nav>
73
- );
74
- };
75
-
76
- export default BreadcrumbNavigation;
1
+ import React from "react";
2
+ import Button from "../button";
3
+ import { BreadcrumbNavigationProps } from "./types";
4
+
5
+ import { MaterialIcon } from "@shared/components/material-icon";
6
+ import { Text } from "@shared/components/text";
7
+
8
+ export const BreadcrumbNavigation: React.FC<
9
+ BreadcrumbNavigationProps
10
+ > = props => {
11
+ const {
12
+ links = [],
13
+ textColor = "dark",
14
+ maxWidth = true,
15
+ floatOnMobile = false,
16
+ } = 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";
24
+ if (!links.length) return null;
25
+ return (
26
+ <nav
27
+ aria-label="Breadcrumb"
28
+ className={`${maxWidth ? "mx-5 max-w-120 xl:mx-auto" : "mx-auto"} relative`}
29
+ >
30
+ <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`}
32
+ >
33
+ {links.map((link, index) => {
34
+ const { image, ...linkProps } = link;
35
+ const imageSrc = image?.url
36
+ ? image.url.startsWith("//")
37
+ ? `https:${image.url}`
38
+ : image.url
39
+ : "";
40
+ const isLast = index === links.length - 1;
41
+ return !isLast ? (
42
+ <li key={index} className="flex flex-none items-center">
43
+ {imageSrc && (
44
+ <img
45
+ src={imageSrc}
46
+ alt={image?.alt || ""}
47
+ width={20}
48
+ height={20}
49
+ className="mr-2 h-10 w-10"
50
+ />
51
+ )}
52
+ <Button
53
+ {...linkProps}
54
+ linkClassName={`label3 mr-2 whitespace-nowrap ${color}`}
55
+ linkVariant="unstyled"
56
+ />
57
+ <MaterialIcon name="chevron_right" className={`${color} `} />
58
+ </li>
59
+ ) : (
60
+ <li key={index} className="flex min-w-0 items-center">
61
+ {imageSrc && (
62
+ <img
63
+ src={imageSrc}
64
+ alt={image?.alt || ""}
65
+ width={20}
66
+ height={20}
67
+ className="mr-2 h-10 w-10"
68
+ />
69
+ )}
70
+ <Text as="span" className={`body3 mr-2 break-words ${color}`}>
71
+ {link.buttonLabel}
72
+ </Text>
73
+ </li>
74
+ );
75
+ })}
76
+ </ol>
77
+ </nav>
78
+ );
79
+ };
80
+
81
+ export default BreadcrumbNavigation;
@@ -2,4 +2,5 @@ export type BreadcrumbNavigationProps = {
2
2
  links?: Array<any>;
3
3
  textColor?: "dark" | "light";
4
4
  maxWidth?: boolean;
5
+ floatOnMobile?: boolean;
5
6
  };
@@ -62,6 +62,9 @@ export type { BlogCardProps } from "./blocks/cards/blog-card/types";
62
62
  export { BlogGrid } from "./blocks/blogs-grid";
63
63
  export type { BlogGridProps } from "./blocks/blogs-grid/types";
64
64
 
65
+ export { BlogGridBase } from "./blocks/blogs-grid-base";
66
+ export type { BlogGridBaseProps } from "./blocks/blogs-grid-base/types";
67
+
65
68
  export { BreadcrumbNavigation } from "./blocks/breadcrumbs";
66
69
  export type { BreadcrumbNavigationProps } from "./blocks/breadcrumbs/types";
67
70