@windstream/react-shared-components 0.1.56 → 0.1.57
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.esm.js +2 -2
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +2 -2
- package/dist/contentful/index.js.map +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 +1 -1
- package/dist/next/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/next-image/index.tsx +1 -7
- package/src/contentful/blocks/breadcrumbs/index.tsx +75 -76
package/package.json
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import
|
|
4
|
+
import NextJsImage, {
|
|
5
5
|
type ImageLoaderProps,
|
|
6
6
|
type ImageProps as NextImageProps,
|
|
7
7
|
} from "next/image";
|
|
8
8
|
|
|
9
9
|
import { cx } from "@shared/utils";
|
|
10
10
|
|
|
11
|
-
// Handle CJS/ESM interop: next/image default export may be wrapped as { default: ... }
|
|
12
|
-
const NextJsImage =
|
|
13
|
-
typeof (NextJsImageImport as any).default === "function"
|
|
14
|
-
? (NextJsImageImport as any).default
|
|
15
|
-
: NextJsImageImport;
|
|
16
|
-
|
|
17
11
|
export interface NextImageComponentProps extends NextImageProps {
|
|
18
12
|
className?: string;
|
|
19
13
|
}
|
|
@@ -1,76 +1,75 @@
|
|
|
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
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
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 { links = [], textColor = "dark", maxWidth = true } = props;
|
|
12
|
+
const color =
|
|
13
|
+
textColor === "dark"
|
|
14
|
+
? "text-white xl:text-text"
|
|
15
|
+
: "text-text xl:text-white";
|
|
16
|
+
if (!links.length) return null;
|
|
17
|
+
return (
|
|
18
|
+
<nav
|
|
19
|
+
aria-label="Breadcrumb"
|
|
20
|
+
className={`${maxWidth ? "mx-5 max-w-120 xl:mx-auto" : "mx-auto"} relative`}
|
|
21
|
+
>
|
|
22
|
+
<ol
|
|
23
|
+
className={
|
|
24
|
+
"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"
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
{links.map((link, index) => {
|
|
28
|
+
const { image, ...linkProps } = link;
|
|
29
|
+
const imageSrc = image?.url
|
|
30
|
+
? image.url.startsWith("//")
|
|
31
|
+
? `https:${image.url}`
|
|
32
|
+
: image.url
|
|
33
|
+
: "";
|
|
34
|
+
const isLast = index === links.length - 1;
|
|
35
|
+
return !isLast ? (
|
|
36
|
+
<li key={index} className="flex flex-none items-center">
|
|
37
|
+
{imageSrc && (
|
|
38
|
+
<img
|
|
39
|
+
src={imageSrc}
|
|
40
|
+
alt={image?.alt || ""}
|
|
41
|
+
width={20}
|
|
42
|
+
height={20}
|
|
43
|
+
className="mr-2"
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
<Button
|
|
47
|
+
{...linkProps}
|
|
48
|
+
linkClassName={`label3 mr-2 whitespace-nowrap ${color}`}
|
|
49
|
+
linkVariant="unstyled"
|
|
50
|
+
/>
|
|
51
|
+
<MaterialIcon name="chevron_right" className={`${color} `} />
|
|
52
|
+
</li>
|
|
53
|
+
) : (
|
|
54
|
+
<li key={index} className="flex min-w-0 items-center">
|
|
55
|
+
{imageSrc && (
|
|
56
|
+
<img
|
|
57
|
+
src={imageSrc}
|
|
58
|
+
alt={image?.alt || ""}
|
|
59
|
+
width={20}
|
|
60
|
+
height={20}
|
|
61
|
+
className="mr-2"
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
<Text as="span" className={`body3 mr-2 break-words ${color}`}>
|
|
65
|
+
{link.buttonLabel}
|
|
66
|
+
</Text>
|
|
67
|
+
</li>
|
|
68
|
+
);
|
|
69
|
+
})}
|
|
70
|
+
</ol>
|
|
71
|
+
</nav>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default BreadcrumbNavigation;
|