@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.
- package/dist/contentful/index.d.ts +37 -6
- package/dist/contentful/index.esm.js +2 -2
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +3 -3
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/next/index.esm.js +1 -1
- package/dist/next/index.esm.js.map +1 -1
- package/dist/next/index.js +2 -2
- package/dist/next/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/next-image/index.tsx +1 -7
- package/src/contentful/blocks/blogs-grid-base/index.tsx +114 -0
- package/src/contentful/blocks/blogs-grid-base/types.ts +29 -0
- package/src/contentful/blocks/breadcrumbs/index.tsx +81 -76
- package/src/contentful/blocks/breadcrumbs/types.ts +1 -0
- package/src/contentful/index.ts +3 -0
|
@@ -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 {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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;
|
package/src/contentful/index.ts
CHANGED
|
@@ -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
|
|