@windstream/react-shared-components 0.0.52 → 0.0.54
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 +1 -1
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +1 -1
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/checklist/index.tsx +53 -39
- package/src/components/checklist/types.ts +3 -1
- package/src/contentful/blocks/image-promo-bar/index.tsx +4 -2
package/package.json
CHANGED
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { ChecklistProps } from "@shared/components/checklist/types";
|
|
4
|
-
import { List, ListItem } from "@shared/components/list";
|
|
5
|
-
import { MaterialIcon } from "@shared/components/material-icon";
|
|
6
|
-
import { Text } from "@shared/components/text";
|
|
7
|
-
import { cx } from "@shared/utils";
|
|
8
|
-
|
|
9
|
-
export const Checklist: React.FC<ChecklistProps> = props => {
|
|
10
|
-
const {
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { ChecklistProps } from "@shared/components/checklist/types";
|
|
4
|
+
import { List, ListItem } from "@shared/components/list";
|
|
5
|
+
import { MaterialIcon } from "@shared/components/material-icon";
|
|
6
|
+
import { Text } from "@shared/components/text";
|
|
7
|
+
import { cx } from "@shared/utils";
|
|
8
|
+
|
|
9
|
+
export const Checklist: React.FC<ChecklistProps> = props => {
|
|
10
|
+
const {
|
|
11
|
+
items,
|
|
12
|
+
listIconName = "check",
|
|
13
|
+
listItemClassName,
|
|
14
|
+
iconSize = 20,
|
|
15
|
+
iconPosition = "center",
|
|
16
|
+
} = props;
|
|
17
|
+
const showIcons = listIconName !== "disc";
|
|
18
|
+
if (!items?.length) return null;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<List
|
|
22
|
+
className="mt-2 space-y-1"
|
|
23
|
+
variant={showIcons ? "default" : "unstyled"}
|
|
24
|
+
>
|
|
25
|
+
{items.map((text, idx) => (
|
|
26
|
+
<ListItem
|
|
27
|
+
variant={showIcons ? "default" : "unstyled"}
|
|
28
|
+
key={idx}
|
|
29
|
+
className={cx(
|
|
30
|
+
`flex ${iconPosition === "top" ? "items-start" : "items-center"} gap-2 text-text-secondary`,
|
|
31
|
+
listItemClassName
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{showIcons && (
|
|
35
|
+
<div>
|
|
36
|
+
<MaterialIcon
|
|
37
|
+
name={listIconName}
|
|
38
|
+
size={iconSize}
|
|
39
|
+
weight="600"
|
|
40
|
+
className={`text-icon-brand ${iconPosition === "top" ? "mt-2" : ""}`}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
<Text as="div">{text}</Text>
|
|
45
|
+
</ListItem>
|
|
46
|
+
))}
|
|
47
|
+
</List>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
Checklist.displayName = "Checklist";
|
|
52
|
+
|
|
53
|
+
export type { ChecklistProps };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type ChecklistProps = {
|
|
2
2
|
items: React.ReactNode[];
|
|
3
3
|
// TODO: add icon names as needed
|
|
4
|
-
listIconName?: "check";
|
|
4
|
+
listIconName?: "check" | "disc";
|
|
5
5
|
listItemClassName?: string;
|
|
6
|
+
iconSize?: 20 | 24 | 32 | 40 | 48 | 52 | undefined;
|
|
7
|
+
iconPosition?: "top" | "center";
|
|
6
8
|
};
|
|
@@ -71,7 +71,9 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
71
71
|
</Text>
|
|
72
72
|
)}
|
|
73
73
|
{/* Checklist Rendering */}
|
|
74
|
-
{checklist.length > 0 &&
|
|
74
|
+
{checklist.length > 0 && (
|
|
75
|
+
<Checklist items={checklist} iconPosition="top" iconSize={24} />
|
|
76
|
+
)}
|
|
75
77
|
{/* Image Links Collection */}
|
|
76
78
|
{imageLinks?.map((link, index) => (
|
|
77
79
|
<div key={index} className="image-link">
|
|
@@ -103,7 +105,7 @@ export const ImagePromoBar: React.FC<ImagePromoBarProps> = ({
|
|
|
103
105
|
alt="section-image"
|
|
104
106
|
width={imageWidth}
|
|
105
107
|
height={imageHeight}
|
|
106
|
-
className="
|
|
108
|
+
className="bottom-0 left-0 right-0 top-0 h-full rounded-[40px] object-cover"
|
|
107
109
|
/>
|
|
108
110
|
)}
|
|
109
111
|
</div>
|