@agilant/toga-blox 1.0.21 → 1.0.23
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/components/Badge/Badge.d.ts +1 -3
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Badge/Badge.stories.d.ts +1 -1
- package/dist/components/Badge/Badge.stories.js +8 -3
- package/dist/components/BaseButton/BaseButton.d.ts +4 -0
- package/dist/components/BaseButton/BaseButton.js +49 -0
- package/dist/components/BaseButton/BaseButton.stories.d.ts +12 -0
- package/dist/components/BaseButton/BaseButton.stories.js +200 -0
- package/dist/components/BaseButton/BaseButton.test.d.ts +1 -0
- package/dist/components/BaseButton/BaseButton.test.js +59 -0
- package/dist/components/BaseButton/BaseButton.types.d.ts +24 -0
- package/dist/components/BaseButton/BaseButton.types.js +1 -0
- package/dist/components/BaseButton/index.d.ts +2 -0
- package/dist/components/BaseButton/index.js +2 -0
- package/dist/components/Card/DUMMYPRODUCTDATA.json +2 -1
- package/dist/components/Card/templates/CounterContentCardTemplate.js +2 -2
- package/dist/components/Card/templates/HorizontalCardTemplate.js +3 -3
- package/dist/components/Card/templates/ItemCardTemplate.js +2 -2
- package/dist/components/Card/templates/KitContentCardTemplate.js +2 -2
- package/dist/components/Card/templates/ShippingAddressCardTemplate.js +2 -2
- package/dist/components/Card/templates/VerticalCardTemplate.js +2 -2
- package/dist/components/CounterButton/CounterButton.js +2 -2
- package/dist/components/GenericList/GenericList.js +12 -3
- package/dist/components/GetSupport/GetSupport.js +2 -2
- package/dist/components/Header/Header.stories.js +3 -3
- package/dist/components/ImageContainer/ImageContainer.d.ts +4 -0
- package/dist/components/ImageContainer/ImageContainer.js +7 -0
- package/dist/components/ImageContainer/ImageContainer.stories.d.ts +6 -0
- package/dist/components/ImageContainer/ImageContainer.stories.js +68 -0
- package/dist/components/ImageContainer/ImageContainer.test.d.ts +1 -0
- package/dist/components/ImageContainer/ImageContainer.test.js +23 -0
- package/dist/components/ImageContainer/ImageContainer.types.d.ts +9 -0
- package/dist/components/ImageContainer/ImageContainer.types.js +1 -0
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/Input.stories.js +4 -4
- package/dist/components/Input/Input.test.js +2 -2
- package/dist/components/Page/ViewPageTemplate.stories.js +3 -3
- package/dist/components/Page/ViewPageTemplate.test.js +2 -2
- package/dist/components/PageSection/PageSection.d.ts +1 -1
- package/dist/components/PageSection/PageSection.stories.js +4 -3
- package/dist/components/PageSection/PageSections.test.js +13 -3
- package/dist/components/SearchInput/SearchInput.js +2 -2
- package/package.json +1 -1
- package/dist/main.css +0 -1
|
@@ -27,20 +27,29 @@ const GenericList = ({ data, renderItem, itemHeight, containerHeight, containerC
|
|
|
27
27
|
switch (listType) {
|
|
28
28
|
case "ordered":
|
|
29
29
|
return (_jsx("ol", { ref: parentRef, style: hasVirtualization
|
|
30
|
-
? {
|
|
30
|
+
? {
|
|
31
|
+
height: containerHeight,
|
|
32
|
+
overflow: "scroll",
|
|
33
|
+
}
|
|
31
34
|
: {}, className: `${listClasses} ${containerClasses}`, children: hasVirtualization
|
|
32
35
|
? virtualItems.map((virtualItem) => (_jsx("li", { style: { height: itemHeight }, children: renderItem(data[virtualItem.index]) }, virtualItem.index)))
|
|
33
36
|
: nonVirtualItems.map((item) => (_jsx("li", { children: renderItem(item) }, item.id))) }));
|
|
34
37
|
case "unordered":
|
|
35
38
|
return (_jsx("ul", { ref: parentRef, style: hasVirtualization
|
|
36
|
-
? {
|
|
39
|
+
? {
|
|
40
|
+
height: containerHeight,
|
|
41
|
+
overflow: "scroll",
|
|
42
|
+
}
|
|
37
43
|
: {}, className: `${listClasses} ${containerClasses}`, children: hasVirtualization
|
|
38
44
|
? virtualItems.map((virtualItem) => (_jsx("li", { style: { height: itemHeight }, children: renderItem(data[virtualItem.index]) }, virtualItem.index)))
|
|
39
45
|
: nonVirtualItems.map((item) => (_jsx("li", { children: renderItem(item) }, item.id))) }));
|
|
40
46
|
case "none":
|
|
41
47
|
default:
|
|
42
48
|
return (_jsx("div", { ref: parentRef, style: hasVirtualization
|
|
43
|
-
? {
|
|
49
|
+
? {
|
|
50
|
+
height: containerHeight,
|
|
51
|
+
overflow: "scroll",
|
|
52
|
+
}
|
|
44
53
|
: {}, className: `${listClasses} ${containerClasses}`, children: hasVirtualization
|
|
45
54
|
? virtualItems.map((virtualItem) => (_jsx("div", { style: { height: itemHeight }, children: renderItem(data[virtualItem.index]) }, virtualItem.index)))
|
|
46
55
|
: nonVirtualItems.map((item) => (_jsx("div", { children: renderItem(item) }, item.id))) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
3
3
|
import Text from "../Text/Text";
|
|
4
4
|
const GetSupport = ({ as, to, icon, iconClasses, title, titleClasses, subTitle, subTitleClasses, containerClasses, }) => {
|
|
5
|
-
return (_jsx(
|
|
5
|
+
return (_jsx(BaseButton, { as: as, to: to, text: _jsxs("div", { className: `flex items-center gap-4 ${containerClasses}`, children: [_jsx("div", { className: `flex items-center justify-center ${iconClasses}`, children: icon }), _jsxs("div", { className: "flex flex-col", children: [_jsx(Text, { size: "text-md", color: "text-black", text: title, fontFamily: "font-serif", tag: "p", additionalClasses: titleClasses }), subTitle && (_jsx(Text, { size: "text-md", color: "text-black", text: subTitle, fontFamily: "font-serif", tag: "p", additionalClasses: subTitleClasses }))] })] }), backgroundColor: "bg-transparent", borderColor: "border-none", shape: "rounded-md", additionalClasses: containerClasses }));
|
|
6
6
|
};
|
|
7
7
|
export default GetSupport;
|
|
@@ -5,7 +5,7 @@ import Image from "../Image/Image";
|
|
|
5
5
|
import Badge from "../Badge/Badge";
|
|
6
6
|
import Text from "../Text/Text";
|
|
7
7
|
import Input from "../Input/Input";
|
|
8
|
-
import
|
|
8
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
9
9
|
import { DUMMYCOMPASSNAVDATA, DUMMYNAVDATA } from "../Nav/DUMMYNAVDATA.json";
|
|
10
10
|
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
11
11
|
export default {
|
|
@@ -131,7 +131,7 @@ Default.args = {
|
|
|
131
131
|
),
|
|
132
132
|
badge: (_jsx(Badge, { type: "href", to: "#", hoverColor: "blue", borderColor: "none", mobileIcon: getFontAwesomeIcon("square-phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) })),
|
|
133
133
|
nav: (_jsx(Nav, { navData: DUMMYNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "blue", parentHoverFontColor: "white", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "cornered", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "blue", submenuHoverBackground: "white", submenuHoverBorderStyle: "bottom", submenuHoverBorderColor: "black", mobileBreakpoint: "extraLarge", accordionParentStyle: "cornered p-2 w-full border-b-2 border-b-blue-700 text-black", accordionExpandedStyle: "pl-2 py-3" })),
|
|
134
|
-
input: (_jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", hasPlaceholder: true, placeholder: "Search", borderColor: "gray", hasButton: true, backgroundColor: "white", additionalClasses: "bg-blue-500", button: _jsx(
|
|
134
|
+
input: (_jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", hasPlaceholder: true, placeholder: "Search", borderColor: "gray", hasButton: true, backgroundColor: "white", additionalClasses: "bg-blue-500", button: _jsx(BaseButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "blue", hoverBackground: "black", hoverFontColor: "white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" })),
|
|
135
135
|
logoBorderRadius: true,
|
|
136
136
|
logoHoverColor: "blue",
|
|
137
137
|
hasIcons: false,
|
|
@@ -188,7 +188,7 @@ Compass.args = {
|
|
|
188
188
|
badge: (_jsx(Badge, { type: "href", to: "#", hoverColor: "green", borderColor: "none", mobileIcon: getFontAwesomeIcon("square-phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-teal-700", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-teal-700", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) })),
|
|
189
189
|
logo: (_jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" })),
|
|
190
190
|
nav: (_jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "cornered", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "white", submenuHoverBackground: "green", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "green", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "cornered p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" })),
|
|
191
|
-
input: (_jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "gray", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "white", additionalClasses: "bg-blue-500", button: _jsx(
|
|
191
|
+
input: (_jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "gray", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "white", additionalClasses: "bg-blue-500", button: _jsx(BaseButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "green", hoverBackground: "black", hoverFontColor: "white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" })),
|
|
192
192
|
};
|
|
193
193
|
export const NoSearchOrBadge = Template.bind({});
|
|
194
194
|
NoSearchOrBadge.args = {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const ImageContainer = (props) => {
|
|
3
|
+
const { imageUrl, backgroundColor, borderRadius, size, alternativeText, userInitials, additionalClasses, } = props;
|
|
4
|
+
console.log(`${borderRadius} ${backgroundColor} ${size} flex items-center justify-center overflow-hidden ${additionalClasses}`, "in component ");
|
|
5
|
+
return (_jsx("div", { className: `${borderRadius} ${backgroundColor} ${size} flex items-center justify-center overflow-hidden ${additionalClasses}`, children: imageUrl ? (_jsx("img", { src: imageUrl, alt: alternativeText, className: `${size}` })) : (_jsx("p", { className: `text-xs text-white w-full h-full flex justify-center items-center `, children: userInitials || "N/A" })) }));
|
|
6
|
+
};
|
|
7
|
+
export default ImageContainer;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ImageContainer from "./ImageContainer";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/ImageContainer",
|
|
5
|
+
component: ImageContainer,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
imageUrl: {
|
|
12
|
+
control: "none",
|
|
13
|
+
description: "Image url of the image.",
|
|
14
|
+
},
|
|
15
|
+
backgroundColor: {
|
|
16
|
+
control: "none",
|
|
17
|
+
description: "Background color if the image is not present.",
|
|
18
|
+
},
|
|
19
|
+
borderRadius: {
|
|
20
|
+
control: "none",
|
|
21
|
+
description: "Styles for the content.",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
control: "none",
|
|
25
|
+
description: "Size of the container.",
|
|
26
|
+
},
|
|
27
|
+
profileIcon: {
|
|
28
|
+
control: "none",
|
|
29
|
+
description: "Profile icon image.",
|
|
30
|
+
},
|
|
31
|
+
alternativeText: {
|
|
32
|
+
control: "none",
|
|
33
|
+
description: "Alternative text for the image.",
|
|
34
|
+
},
|
|
35
|
+
userInitials: {
|
|
36
|
+
control: "none",
|
|
37
|
+
description: "User initials if there is no image.",
|
|
38
|
+
},
|
|
39
|
+
additionalClasses: {
|
|
40
|
+
control: "none",
|
|
41
|
+
description: "Additional styling classes of the image container.",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const Template = (args) => (_jsx(ImageContainer, { ...args }));
|
|
46
|
+
export const Default = Template.bind({});
|
|
47
|
+
Default.args = {
|
|
48
|
+
imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxASEBAQEBEWFRAWGRUWEBUVGQ8QEBUSGBYYGxgXFxcYICkgGxolHhcYITEhJyorLi4wGB8zODMsNzQtLi0BCgoKDg0OGxAQGS4dHiItKzcxLS0tKy0tLS8tLTUtLy0tLS0wLS0tLS0tLy0uLS0tLS0tLS0uLS0tLS0tKy0rLf/AABEIAMgAyAMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYBBAcDAgj/xABAEAABAwIDBQQIBAQFBQEAAAABAAIDBBEFEjEGEyFBUSJCgZEHFCMyUmFxwWKhsdEXkrLwNDVzovEkdMLh4hX/xAAaAQEAAgMBAAAAAAAAAAAAAAAAAQQCAwUG/8QAKxEAAgIBBAIBAgUFAAAAAAAAAAECEQMEEiExE0FRFNEiMn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aaGbt+oDhaxRFFsk1Bh9YGbkVDN3bKJMjvWAz65sua3et4Laq8Ma6lfSx9lpjMbOdhlsPqiKXJkUeOPYIKhjbOySN4B443ZcZmOHNpt5gLdropXNG6kDHg37TQ9jgL9kjW3HUHkiJuYo1aCgkEz55nMMhaGARtLWhoJNySSSePgpVERuyTSw+jMe9ub55HSDlYOtw/Ja0eDN9W9Xe6/ae5rx2XNcZHPa5vQi6Im5ij0w/DAylbTSHOMhY82tmBvfh4rWioaxrRE2oZuxwa8sJnDRoNcpdyzW8ERN7tkUTQWURQSEREB//2Q==",
|
|
49
|
+
borderRadius: "rounded-md",
|
|
50
|
+
size: "size-80",
|
|
51
|
+
alternativeText: "image",
|
|
52
|
+
};
|
|
53
|
+
export const ProfileIcon = Template.bind({});
|
|
54
|
+
ProfileIcon.args = {
|
|
55
|
+
imageUrl: "https://img.freepik.com/premium-vector/avatar-profile-icon-flat-style-female-user-profile-vector-illustration-isolated-background-women-profile-sign-business-concept_157943-38866.jpg",
|
|
56
|
+
borderRadius: "rounded-full",
|
|
57
|
+
size: "h-[75px] w-[75px]",
|
|
58
|
+
alternativeText: "profile image",
|
|
59
|
+
};
|
|
60
|
+
export const WithoutImage = Template.bind({});
|
|
61
|
+
WithoutImage.args = {
|
|
62
|
+
imageUrl: "",
|
|
63
|
+
borderRadius: "rounded-full",
|
|
64
|
+
size: "h-14 w-14",
|
|
65
|
+
alternativeText: "",
|
|
66
|
+
userInitials: "AS",
|
|
67
|
+
backgroundColor: "bg-gray-500",
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import ImageContainer from "./ImageContainer";
|
|
5
|
+
describe("ImageContainer Component", () => {
|
|
6
|
+
const testUrl = "https://via.placeholder.com/150";
|
|
7
|
+
it("renders an image when a valid imageUrl is provided", () => {
|
|
8
|
+
const { getByAltText } = render(_jsx(ImageContainer, { imageUrl: testUrl, borderRadius: "rounded-md", size: "size-80", alternativeText: "image" }));
|
|
9
|
+
const image = getByAltText("image");
|
|
10
|
+
expect(image).toBeInTheDocument();
|
|
11
|
+
expect(image).toHaveAttribute("src", testUrl);
|
|
12
|
+
});
|
|
13
|
+
it("renders fallback text when no imageUrl is provided", () => {
|
|
14
|
+
const { getByText } = render(_jsx(ImageContainer, { imageUrl: "", userInitials: "AB" }));
|
|
15
|
+
const userInitials = getByText("AB");
|
|
16
|
+
expect(userInitials).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
it("applies rounded-full class when borderRadius is rounded-full", () => {
|
|
19
|
+
const { container, getByAltText } = render(_jsx(ImageContainer, { imageUrl: testUrl, alternativeText: "Profile icon", borderRadius: "rounded-full" }));
|
|
20
|
+
const imageElement = container.querySelector("div");
|
|
21
|
+
expect(imageElement).toHaveClass("rounded-full");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import
|
|
3
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
4
4
|
import { validateInput } from "../../utils/inputValidation";
|
|
5
5
|
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
6
6
|
const Input = ({
|
|
@@ -17,7 +17,7 @@ hasLeftIcon, hasRightIcon, leftIcon, rightIcon, iconColor = "text-gray-500", ico
|
|
|
17
17
|
// INPUT STYLES
|
|
18
18
|
inputTextSize = "text-base", inputShape = "rounded-md", borderColor = "border-gray-300", backgroundColor = "bg-white", inputWidth = "w-full", errorBorder = "border-red-500", successBorder = "border-green-500",
|
|
19
19
|
// BUTTON
|
|
20
|
-
hasButton, button = (_jsx(
|
|
20
|
+
hasButton, button = (_jsx(BaseButton, { text: "Submit", as: "button", hoverBackground: "hover:bg-green-500", backgroundColor: "bg-red-500", icon: getFontAwesomeIcon("arrow-right"), borderColor: "border-green-500", hoverFontColor: "hover:text-black", shape: "rounded-none", additionalClasses: "h-full" })), }) => {
|
|
21
21
|
const [isValid, setIsValid] = useState("");
|
|
22
22
|
const [termInternal, setTermInternal] = useState("");
|
|
23
23
|
const [inputBorderClasses, setInputBorderClasses] = useState(borderColor);
|
|
@@ -4,7 +4,7 @@ import Text from "../Text/Text";
|
|
|
4
4
|
import { minCharactersRegex } from "../../utils/inputValidation";
|
|
5
5
|
import { withMemo } from "../../userHoc";
|
|
6
6
|
import { arePropsEqual } from "./InputMemoTypes";
|
|
7
|
-
import
|
|
7
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
8
8
|
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
9
9
|
const MemoizedInput = withMemo(Input, arePropsEqual);
|
|
10
10
|
export default {
|
|
@@ -191,7 +191,7 @@ NoIcons.args = {
|
|
|
191
191
|
leftIcon: getFontAwesomeIcon("search"),
|
|
192
192
|
rightIcon: getFontAwesomeIcon("arrow-right"),
|
|
193
193
|
hasButton: true,
|
|
194
|
-
button: (_jsx(
|
|
194
|
+
button: (_jsx(BaseButton, { text: "", as: "button", hoverBackground: "hover:bg-green-500", backgroundColor: "bg-green-500", icon: getFontAwesomeIcon("search"), additionalClasses: "items-center px-2 h-full", borderColor: "border-none", hoverFontColor: "hover:text-black", shape: "rounded", onClick: () => alert("Button clicked!") })),
|
|
195
195
|
inputTextSize: "text-md",
|
|
196
196
|
inputWidth: "w-96",
|
|
197
197
|
inputShape: "rounded",
|
|
@@ -275,7 +275,7 @@ ButtonWithValidation.args = {
|
|
|
275
275
|
hasRightIcon: false,
|
|
276
276
|
hasLeftIcon: false,
|
|
277
277
|
hasButton: true,
|
|
278
|
-
button: (_jsx(
|
|
278
|
+
button: (_jsx(BaseButton, { text: "", as: "button", hoverBackground: "hover:bg-green-500", backgroundColor: "bg-green-500", icon: getFontAwesomeIcon("search"), additionalClasses: "items-center px-2 h-full", borderColor: "border-none", hoverFontColor: "hover:text-black", shape: "rounded", onClick: () => alert("Button clicked!") })),
|
|
279
279
|
};
|
|
280
280
|
export const ButtonWithLeftIcon = Template.bind({});
|
|
281
281
|
ButtonWithLeftIcon.args = {
|
|
@@ -294,7 +294,7 @@ ButtonWithLeftIcon.args = {
|
|
|
294
294
|
leftIcon: getFontAwesomeIcon("search"),
|
|
295
295
|
iconBackgroundColor: "none",
|
|
296
296
|
hasButton: true,
|
|
297
|
-
button: (_jsx(
|
|
297
|
+
button: (_jsx(BaseButton, { text: "", as: "button", hoverBackground: "hover:bg-green-500", backgroundColor: "bg-green-500", icon: getFontAwesomeIcon("search"), additionalClasses: "items-center px-2 h-full", borderColor: "border-none", hoverFontColor: "hover:text-black", shape: "rounded", onClick: () => alert("Button clicked!") })),
|
|
298
298
|
};
|
|
299
299
|
export const DateInput = Template.bind({});
|
|
300
300
|
DateInput.args = {
|
|
@@ -4,7 +4,7 @@ import { render, screen } from "@testing-library/react";
|
|
|
4
4
|
import { describe, test, expect, beforeEach } from "vitest";
|
|
5
5
|
import Input from "./Input";
|
|
6
6
|
import Text from "../Text/Text";
|
|
7
|
-
import
|
|
7
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
8
8
|
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
9
9
|
describe("<Input /> with all props", () => {
|
|
10
10
|
beforeEach(() => {
|
|
@@ -20,7 +20,7 @@ describe("<Input /> with all props", () => {
|
|
|
20
20
|
// INPUT STYLES
|
|
21
21
|
inputTextSize: "medium", inputShape: "cornered", borderColor: "green", backgroundColor: "none", inputWidth: "w-96",
|
|
22
22
|
// BUTTON
|
|
23
|
-
hasButton: true, button: _jsx(
|
|
23
|
+
hasButton: true, button: _jsx(BaseButton, { text: "Submit", as: "button", hoverBackground: "green", backgroundColor: "green", icon: getFontAwesomeIcon("arrow-right"), additionalClasses: "items-center px-4", borderColor: "green", hoverFontColor: "black", shape: "cornered" }) }));
|
|
24
24
|
});
|
|
25
25
|
test("renders Input component", () => {
|
|
26
26
|
expect(screen.getByTestId("input-container")).toBeInTheDocument();
|
|
@@ -8,7 +8,7 @@ import Image from "../Image/Image";
|
|
|
8
8
|
import Input from "../Input/Input";
|
|
9
9
|
import Nav from "../Nav/Nav";
|
|
10
10
|
import Card from "../Card/Card";
|
|
11
|
-
import
|
|
11
|
+
import BaseButton from "../BaseButton";
|
|
12
12
|
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
13
13
|
import ViewTemplatePage from "./ViewPageTemplate";
|
|
14
14
|
import Footer from "../Footer/Footer";
|
|
@@ -45,7 +45,7 @@ ViewWithHeroAndCardsWithGlassHeader.args = {
|
|
|
45
45
|
children: [
|
|
46
46
|
//the div acts as a spacer for the header because the header is fixed
|
|
47
47
|
_jsx("div", { className: "h-16" }, "spacer"),
|
|
48
|
-
_jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, logoBorderRadius: true, logoHoverColor: "hover:bg-blue-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-black", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-blue-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, hasAnimatedHamburgerButton: true, icons: _jsx(_Fragment, {}), badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-blue-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/Logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-blue-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-blue-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-blue-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(
|
|
48
|
+
_jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, logoBorderRadius: true, logoHoverColor: "hover:bg-blue-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-black", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-blue-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, hasAnimatedHamburgerButton: true, icons: _jsx(_Fragment, {}), badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-blue-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/Logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-blue-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-blue-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-blue-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(BaseButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "bg-blue-500", hoverBackground: "hover:bg-black", hoverFontColor: "hover:text-white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" }) }) }, "header"),
|
|
49
49
|
_jsx(Hero, { textAlignment: "center", background: "image" }, "hero"),
|
|
50
50
|
_jsx(PageSection, { sectionContainerClasses: "flex flex-col w-full h-full bg-slate-100 p-6\n justify-center items-center max-sm:p-2 max-w-pageSectionMaxWidth mx-auto", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "unordered", hasVirtualization: false, containerClasses: "w-full h-[100%] grid grid-cols-4 gap-y-12 gap-x-8 max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: { ...item, title: "" } }) }, item.id)) }) }, "pageSectionOne"),
|
|
51
51
|
],
|
|
@@ -68,6 +68,6 @@ ViewWithTableAndTitle.args = {
|
|
|
68
68
|
export const CompassPageView = Template.bind({});
|
|
69
69
|
CompassPageView.args = {
|
|
70
70
|
children: [
|
|
71
|
-
_jsxs("div", { children: [_jsx("div", { className: "h-16" }), _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, icons: _jsx(_Fragment, {}), hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, hasAnimatedHamburgerButton: true, logoBorderRadius: true, logoHoverColor: "hover:bg-green-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-green-500", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-green-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-green-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-green-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-green-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(
|
|
71
|
+
_jsxs("div", { children: [_jsx("div", { className: "h-16" }), _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, icons: _jsx(_Fragment, {}), hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, hasAnimatedHamburgerButton: true, logoBorderRadius: true, logoHoverColor: "hover:bg-green-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-green-500", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-green-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-green-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-green-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-green-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(BaseButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "bg-green-500", hoverBackground: "hover:bg-black", hoverFontColor: "hover:text-white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" }) }) }), _jsx(Hero, { textAlignment: "left", background: "image", src: "../../../assets/compass-tech-hero-bg.png", text: _jsx(Text, { size: "text-2xl", color: "text-white", fontFamily: "font-serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "w-3/4 max-sm:text-xl max-sm:w-3/4" }) }, "hero"), _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n justify-center items-center h-[100%]", children: _jsx(Text, { size: "text-2xl", color: "text-black", fontFamily: "font-serif", text: "Kits", tag: "h2", additionalClasses: "my-4 max-sm:text-xl" }) }, "pageSection"), _jsx(PageSection, { sectionContainerClasses: "flex flex-col w-full h-full bg-slate-100 p-6\n justify-center items-center max-sm:p-2 max-w-pageSectionMaxWidth mx-auto", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, hasVirtualization: false, listType: "unordered", containerClasses: "w-full grid grid-cols-4 gap-y-12 gap-x-8 max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: { ...item, title: "" } }) }, item.id)) }) }, "pageSectionOne"), _jsxs(PageSection, { sectionContainerClasses: "flex w-full bg-yellow-400 flex p-6 justify-center items-center h-[100%] mt-6 max-sm:flex-col", children: [_jsx(Text, { size: "text-xl", color: "text-black", fontFamily: "font-serif", text: "Help us improve your experience:", tag: "h2", additionalClasses: "p-6 max-sm:p-2 max-sm:text-lg" }), _jsx(BaseButton, { text: _jsx(Text, { size: "", color: "", text: "Take the Survey!", fontFamily: "" }), backgroundColor: "bg-green-500", shape: "rounded", borderColor: "border-none", hoverBackground: "hover:bg-green-500", hoverFontColor: "hover:text-green-500", hoverBorderColor: "hover:border-green-500", hoverUnderline: true, onClick: () => alert("Button clicked!"), as: "a" })] }), _jsx(Footer, { logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Compass Logo.", background: false, additionalClasses: " w-40 p-2" }), title: _jsx(Text, { size: "text-xl", color: "", text: "Compass Website", fontFamily: "", tag: "h2", additionalClasses: "font-bold uppercase pl-2 mt-2" }), slogan: _jsx(Text, { size: "text-md", color: "", text: "Great slogan goes here.", fontFamily: "", tag: "p", additionalClasses: "pl-2" }), copyRightText: _jsx(Text, { size: "md", color: "text-black", text: "Copyright \u00A9 2024 - All right reserved by Generic Company", fontFamily: "", additionalClasses: "text-center" }), socialTitle: _jsx(Text, { size: "md", color: "text-black", text: "Connect", fontFamily: "", additionalClasses: "font-bold uppercase w-full" }), contactTitle: _jsx(Text, { size: "md", color: "text-black", text: "Contact Us:", fontFamily: "", additionalClasses: "font-bold uppercase" }), logoBorderRadius: true, hasNavItems: true, hasSocial: true, logoHoverColor: "hover:bg-green-500", backgroundColor: "bg-green-500", accordionGap: "gap-1", copyRightTextPlacement: "center", socialPlacement: "center", accordionParentStyle: "border-b border-black p-2 w-full", accordionExpandedStyle: "pl-3 py-3" })] }, "randomNumberOne"),
|
|
72
72
|
],
|
|
73
73
|
};
|
|
@@ -9,7 +9,7 @@ import Text from "../Text/Text";
|
|
|
9
9
|
import Image from "../Image/Image";
|
|
10
10
|
import Nav from "../Nav/Nav";
|
|
11
11
|
import Card from "../Card/Card";
|
|
12
|
-
import
|
|
12
|
+
import BaseButton from "../BaseButton";
|
|
13
13
|
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
14
14
|
import Footer from "../Footer/Footer";
|
|
15
15
|
import { DUMMYICONCOMPASSDATA } from "../Header/DUMMYICONDATA.json";
|
|
@@ -38,7 +38,7 @@ describe("<ViewTemplatePage />", () => {
|
|
|
38
38
|
});
|
|
39
39
|
describe("<ViewTemplatePage />", () => {
|
|
40
40
|
beforeEach(() => {
|
|
41
|
-
render(_jsxs(ViewTemplatePage, { children: ["children: [ ", _jsx("div", { className: "h-16" }), ",", _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { hasIcons: true, iconsData: DUMMYICONCOMPASSDATA, logoBorderRadius: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, logoHoverColor: "green", backgroundColor: "gray", bottomBorderColor: "green", badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "green", borderColor: "none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "sm", color: "primary", fontFamily: "serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "xs", color: "primary", fontFamily: "serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "cornered", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "white", submenuHoverBackground: "green", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "green", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "cornered p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }) }) }), ",", _jsx(Hero, { textAlignment: "right", background: "image", src: "../../../assets/compass-tech-hero-bg.png", text: _jsx(Text, { size: "xxxl", color: "white", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "text-left w-3/4 max-xl:text-xl max-lg:text-xl max-md:hidden" }) }, "hero"), ",", _jsx("div", { "data-testid": "kits-header-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\t\tjustify-center items-center h-[100%]", children: _jsx(Text, { size: "xxxl", color: "black", fontFamily: "serif", text: "Kits", tag: "h2", additionalClasses: "my-8" }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "kits-cards-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\tjustify-center items-center h-[100%]", children: _jsx(_Fragment, { children: _jsx("div", { className: "w-3/4 grid grid-cols-4 gap-8 h-[100%] max-xl:gap-1 max-lg:grid-cols-2 max-lg:gap-y-24 max-lg:justify-items-center", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "w-3/4", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) }, item.id)) }) }) }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "survey-section", children: _jsxs(PageSection, { sectionContainerClasses: "w-full bg-yellow-400 flex p-6\n\t\t\t\tjustify-center items-center h-[100%] mt-6", children: [_jsx(Text, { size: "xl", color: "black", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "mr-8" }), _jsx(
|
|
41
|
+
render(_jsxs(ViewTemplatePage, { children: ["children: [ ", _jsx("div", { className: "h-16" }), ",", _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { hasIcons: true, iconsData: DUMMYICONCOMPASSDATA, logoBorderRadius: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, logoHoverColor: "green", backgroundColor: "gray", bottomBorderColor: "green", badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "green", borderColor: "none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "sm", color: "primary", fontFamily: "serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "xs", color: "primary", fontFamily: "serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "cornered", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "white", submenuHoverBackground: "green", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "green", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "cornered p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }) }) }), ",", _jsx(Hero, { textAlignment: "right", background: "image", src: "../../../assets/compass-tech-hero-bg.png", text: _jsx(Text, { size: "xxxl", color: "white", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "text-left w-3/4 max-xl:text-xl max-lg:text-xl max-md:hidden" }) }, "hero"), ",", _jsx("div", { "data-testid": "kits-header-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\t\tjustify-center items-center h-[100%]", children: _jsx(Text, { size: "xxxl", color: "black", fontFamily: "serif", text: "Kits", tag: "h2", additionalClasses: "my-8" }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "kits-cards-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\tjustify-center items-center h-[100%]", children: _jsx(_Fragment, { children: _jsx("div", { className: "w-3/4 grid grid-cols-4 gap-8 h-[100%] max-xl:gap-1 max-lg:grid-cols-2 max-lg:gap-y-24 max-lg:justify-items-center", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "w-3/4", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) }, item.id)) }) }) }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "survey-section", children: _jsxs(PageSection, { sectionContainerClasses: "w-full bg-yellow-400 flex p-6\n\t\t\t\tjustify-center items-center h-[100%] mt-6", children: [_jsx(Text, { size: "xl", color: "black", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "mr-8" }), _jsx(BaseButton, { text: _jsx(Text, { size: "", color: "", text: "Take the Survey!", fontFamily: "" }), shape: "semiRounded", borderColor: "none", hoverBackground: "green", hoverFontColor: "green", hoverBorderColor: "green", hoverUnderline: true, onClick: () => alert("Button clicked!"), as: "a" })] }) }), ",", _jsx(Footer, { logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Compass Logo.", background: false, additionalClasses: " w-40 p-2" }), title: _jsx(Text, { size: "xl", color: "", text: "Compass Website", fontFamily: "", tag: "h2", additionalClasses: "font-bold uppercase pl-2 mt-2 max-md:text-sm" }), slogan: _jsx(Text, { size: "md", color: "", text: "Great slogan goes here.", fontFamily: "", tag: "p", additionalClasses: "pl-2" }), copyRightText: _jsx(Text, { size: "md", color: "black", text: "Copyright \u00A9 2024 - All right reserved by Generic Company", fontFamily: "", additionalClasses: "text-center" }), socialTitle: _jsx(Text, { size: "md", color: "black", text: "Connect", fontFamily: "", additionalClasses: "font-bold uppercase w-full" }), contactTitle: _jsx(Text, { size: "md", color: "black", text: "Contact Us:", fontFamily: "", additionalClasses: "font-bold uppercase" }), logoBorderRadius: true, hasNavItems: true, hasSocial: true, logoHoverColor: "green", backgroundColor: "green", accordionGap: "gap-1", copyRightTextPlacement: "center", socialPlacement: "center", accordionParentStyle: "border-b border-black p-2 w-full", accordionExpandedStyle: "pl-3 py-3" }), ", ]"] }));
|
|
42
42
|
});
|
|
43
43
|
test("renders header on page", () => {
|
|
44
44
|
const header = screen.getByTestId("header");
|
|
@@ -9,6 +9,7 @@ import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/Section",
|
|
11
11
|
component: Section,
|
|
12
|
+
tags: ["autodocs"],
|
|
12
13
|
argTypes: {
|
|
13
14
|
children: {
|
|
14
15
|
control: {
|
|
@@ -25,16 +26,16 @@ export default {
|
|
|
25
26
|
const Template = (args) => _jsx(Section, { ...args });
|
|
26
27
|
export const Default = Template.bind({});
|
|
27
28
|
Default.args = {
|
|
28
|
-
sectionContainerClasses: " flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-
|
|
29
|
+
sectionContainerClasses: " flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-6 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-6",
|
|
29
30
|
children: (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-red-400 p-4", children: "Content 1" }), _jsx("div", { className: "bg-green-400 p-4", children: "Content 2" }), _jsx("div", { className: "bg-blue-400 p-4", children: "Content 3" })] })),
|
|
30
31
|
};
|
|
31
32
|
export const HorizontalCardsSection = Template.bind({});
|
|
32
33
|
HorizontalCardsSection.args = {
|
|
33
34
|
sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center",
|
|
34
|
-
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12" }), _jsx(GenericList, { data: DUMMYPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "flex mb-6 max-sm:w-1/2 max-sm:flex-col overflow-hidden", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(HorizontalCardTemplate, { data: item }) }, item.id)) })] })),
|
|
35
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12 text-xl font-bold" }), _jsx(GenericList, { data: DUMMYPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "flex mb-6 max-sm:w-1/2 max-sm:flex-col overflow-hidden", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(HorizontalCardTemplate, { data: item }) }, item.id)) })] })),
|
|
35
36
|
};
|
|
36
37
|
export const CompassCardsSection = Template.bind({});
|
|
37
38
|
CompassCardsSection.args = {
|
|
38
39
|
sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center h-[100%]",
|
|
39
|
-
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with
|
|
40
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with compass cards:", color: "black", fontFamily: "", additionalClasses: "pb-12 text-xl font-bold" }), _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", containerClasses: "w-full grid grid-cols-4 gap-y-12 gap-x-8 h-full max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) }, item.id)) })] })),
|
|
40
41
|
};
|
|
@@ -6,8 +6,9 @@ import Text from "../Text/Text";
|
|
|
6
6
|
import Card from "../Card/Card";
|
|
7
7
|
import GenericList from "../GenericList/GenericList";
|
|
8
8
|
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
9
|
-
import { DUMMYCOMPASSPRODUCTDATA } from "../../components/Card/DUMMYPRODUCTDATA.json";
|
|
10
|
-
|
|
9
|
+
import { DUMMYPRODUCTDATA, DUMMYCOMPASSPRODUCTDATA, } from "../../components/Card/DUMMYPRODUCTDATA.json";
|
|
10
|
+
import HorizontalCardTemplate from "../Card/templates/HorizontalCardTemplate";
|
|
11
|
+
describe("Section Component(<Section />)", () => {
|
|
11
12
|
beforeEach(() => {
|
|
12
13
|
render(_jsx(Section, { sectionContainerClasses: "flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-4 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-4", children: _jsxs(_Fragment, { children: [_jsx("div", { className: "bg-red-400 p-4", children: "Content 1" }), _jsx("div", { className: "bg-green-400 p-4", children: "Content 2" }), _jsx("div", { className: "bg-blue-400 p-4", children: "Content 3" })] }) }));
|
|
13
14
|
});
|
|
@@ -20,12 +21,21 @@ describe("<Section />", () => {
|
|
|
20
21
|
expect(section).toHaveClass("flex-row");
|
|
21
22
|
});
|
|
22
23
|
});
|
|
24
|
+
describe("<Section /> with horizontal cards", () => {
|
|
25
|
+
it("displays correct cards", () => {
|
|
26
|
+
render(_jsx(Section, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center", children: _jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12 text-xl font-bold" }), _jsx(GenericList, { data: DUMMYPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "flex mb-6 max-sm:w-1/2 max-sm:flex-col overflow-hidden", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(HorizontalCardTemplate, { data: item }) }, item.id)) })] }) }));
|
|
27
|
+
const cards = screen.queryAllByTestId("card");
|
|
28
|
+
expect(cards.length).toBe(6);
|
|
29
|
+
const cardTitles = screen.getAllByText("Crothall iPads - Environmental Services");
|
|
30
|
+
expect(cardTitles).toHaveLength(2);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
23
33
|
describe("<Section /> with compass cards", () => {
|
|
24
34
|
it("displays correct cards", () => {
|
|
25
35
|
render(_jsx(Section, { sectionContainerClasses: "flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-4 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-4", children: _jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12" }), _jsx("div", { className: "grid grid-cols-4 gap-8 h-[100%] max-xl:gap-1 max-lg:grid-cols-2 max-lg:gap-y-24 max-lg:justify-items-center", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "w-3/4", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) })) }) })] }) }));
|
|
26
36
|
const cards = screen.queryAllByTestId("card");
|
|
27
37
|
expect(cards.length).toBe(16);
|
|
28
|
-
expect(cards[0]).toHaveTextContent("
|
|
38
|
+
expect(cards[0]).toHaveTextContent("Environmental Services - Lenovo ThinkPad Universal USB-C Dock");
|
|
29
39
|
expect(cards[3]).toHaveTextContent("Exec RoadWarrior");
|
|
30
40
|
});
|
|
31
41
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import
|
|
3
|
+
import BaseButton from "../BaseButton/BaseButton";
|
|
4
4
|
const SearchInput = ({ label, inputName, inputType, hasPlaceholder, placeholder, inputTextSize, inputShape, backgroundColor, inputWidth, inputBorderClasses, buttonClasses, buttonText, buttonIcon, buttonIconClasses, containerClasses, onButtonClick, role, ariaLabel, }) => {
|
|
5
5
|
const [inputValue, setInputValue] = useState("");
|
|
6
6
|
const handleInputChange = (e) => {
|
|
@@ -12,6 +12,6 @@ const SearchInput = ({ label, inputName, inputType, hasPlaceholder, placeholder,
|
|
|
12
12
|
onButtonClick(inputValue);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
return (_jsx("div", { className: containerClasses, role: role, "aria-label": ariaLabel, children: _jsxs("form", { className: "w-full", children: [_jsx("label", { htmlFor: inputName, className: `sr-only`, children: label }), _jsx("div", { className: "flex w-full", children: _jsxs("div", { className: "flex w-full", children: [_jsx("input", { type: inputType, placeholder: hasPlaceholder ? placeholder : undefined, name: inputName, id: inputName, value: inputValue, onChange: handleInputChange, className: `flex p-2 ${inputTextSize} ${inputShape} ${backgroundColor} ${inputWidth} ${inputBorderClasses}` }), _jsx("div", { className: `flex items-center justify-center h-full`, children: _jsx(
|
|
15
|
+
return (_jsx("div", { className: containerClasses, role: role, "aria-label": ariaLabel, children: _jsxs("form", { className: "w-full", children: [_jsx("label", { htmlFor: inputName, className: `sr-only`, children: label }), _jsx("div", { className: "flex w-full", children: _jsxs("div", { className: "flex w-full", children: [_jsx("input", { type: inputType, placeholder: hasPlaceholder ? placeholder : undefined, name: inputName, id: inputName, value: inputValue, onChange: handleInputChange, className: `flex p-2 ${inputTextSize} ${inputShape} ${backgroundColor} ${inputWidth} ${inputBorderClasses}` }), _jsx("div", { className: `flex items-center justify-center h-full`, children: _jsx(BaseButton, { text: buttonText, icon: buttonIcon, iconClasses: buttonIconClasses, as: "button", additionalClasses: buttonClasses, onClick: handleButtonClick }) })] }) })] }) }));
|
|
16
16
|
};
|
|
17
17
|
export default SearchInput;
|