@agilant/toga-blox 1.0.29 → 1.0.30

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.
Files changed (45) hide show
  1. package/dist/components/BaseButton/BaseButton.d.ts +4 -0
  2. package/dist/components/BaseButton/BaseButton.js +49 -0
  3. package/dist/components/BaseButton/BaseButton.stories.d.ts +12 -0
  4. package/dist/components/BaseButton/BaseButton.stories.js +200 -0
  5. package/dist/components/BaseButton/BaseButton.test.d.ts +1 -0
  6. package/dist/components/BaseButton/BaseButton.test.js +57 -0
  7. package/dist/components/BaseButton/BaseButton.types.d.ts +24 -0
  8. package/dist/components/BaseButton/BaseButton.types.js +1 -0
  9. package/dist/components/BaseButton/index.d.ts +2 -0
  10. package/dist/components/BaseButton/index.js +2 -0
  11. package/dist/components/Card/DUMMYPRODUCTDATA.json +2 -1
  12. package/dist/components/Card/templates/CounterContentCardTemplate.js +2 -2
  13. package/dist/components/Card/templates/HorizontalCardTemplate.js +3 -3
  14. package/dist/components/Card/templates/ItemCardTemplate.js +2 -2
  15. package/dist/components/Card/templates/KitContentCardTemplate.js +2 -2
  16. package/dist/components/Card/templates/ShippingAddressCardTemplate.js +2 -2
  17. package/dist/components/Card/templates/VerticalCardTemplate.js +2 -2
  18. package/dist/components/CounterButton/CounterButton.js +2 -2
  19. package/dist/components/GetSupport/GetSupport.js +2 -2
  20. package/dist/components/Header/Header.stories.js +3 -3
  21. package/dist/components/ImageContainer/ImageContainer.d.ts +4 -0
  22. package/dist/components/ImageContainer/ImageContainer.js +6 -0
  23. package/dist/components/ImageContainer/ImageContainer.stories.d.ts +7 -0
  24. package/dist/components/ImageContainer/ImageContainer.stories.js +88 -0
  25. package/dist/components/ImageContainer/ImageContainer.test.d.ts +1 -0
  26. package/dist/components/ImageContainer/ImageContainer.test.js +63 -0
  27. package/dist/components/ImageContainer/ImageContainer.types.d.ts +11 -0
  28. package/dist/components/ImageContainer/ImageContainer.types.js +1 -0
  29. package/dist/components/Input/Input.js +2 -2
  30. package/dist/components/Input/Input.stories.js +4 -4
  31. package/dist/components/Input/Input.test.js +2 -2
  32. package/dist/components/Page/ViewPageTemplate.stories.js +3 -3
  33. package/dist/components/Page/ViewPageTemplate.test.js +2 -2
  34. package/dist/components/PageSection/PageSection.d.ts +1 -1
  35. package/dist/components/PageSection/PageSection.stories.js +3 -3
  36. package/dist/components/PageSection/PageSections.test.js +13 -3
  37. package/dist/components/SearchInput/SearchInput.js +2 -2
  38. package/dist/components/Text/Text.js +2 -2
  39. package/dist/components/Text/Text.stories.js +7 -0
  40. package/dist/components/Text/Text.test.js +7 -1
  41. package/dist/components/Text/Text.types.d.ts +1 -0
  42. package/dist/components/Toaster/Toaster.js +3 -3
  43. package/dist/components/Toaster/Toaster.stories.js +10 -0
  44. package/dist/components/Toaster/Toaster.types.d.ts +2 -0
  45. package/package.json +1 -1
@@ -0,0 +1,88 @@
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
+ tyle: {
44
+ control: {
45
+ type: "object", // Text input control
46
+ },
47
+ description: "Inline CSS styles to be added.",
48
+ defaultValue: "",
49
+ },
50
+ imageClasses: {
51
+ control: "none",
52
+ description: "Additional styling classes of the image.",
53
+ },
54
+ },
55
+ };
56
+ const Template = (args) => (_jsx(ImageContainer, { ...args }));
57
+ export const Default = Template.bind({});
58
+ Default.args = {
59
+ imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxASEBAQEBEWFRAWGRUWEBUVGQ8QEBUSGBYYGxgXFxcYICkgGxolHhcYITEhJyorLi4wGB8zODMsNzQtLi0BCgoKDg0OGxAQGS4dHiItKzcxLS0tKy0tLS8tLTUtLy0tLS0wLS0tLS0tLy0uLS0tLS0tLS0uLS0tLS0tKy0rLf/AABEIAMgAyAMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYBBAcDAgj/xABAEAABAwIDBQQIBAQFBQEAAAABAAIDBBEFEjEGEyFBUSJCgZEHFCMyUmFxwWKhsdEXkrLwNDVzovEkdMLh4hX/xAAaAQEAAgMBAAAAAAAAAAAAAAAAAQQCAwUG/8QAKxEAAgIBBAIBAgUFAAAAAAAAAAECEQMEEiExE0FRFNEiMnGB8AVDUmHB/9oADAMBAAIRAxEAPwDuKIiAIiIAiIgCIiAIiIDCIq3txjPq9OWNPtZLtb1A7zv76rGclFWzbhxSyzUI9s2cJ2hjnnmhbow2Yfjt735/kptcXwasdE5sjPea64+fyXX8PrGzRMlZo4X+nUFadPm8iafZd/qOi+nknHr/AKbSIisHNCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiA85ZA1pc42ABJJ0AC41tPjBqJ3yk2YOEY6MH76+KunpFxnJGKZh7b+MnyZ08fsVyXEai5yDQa/MrUsUtRlWKPXs7OkcdHp3qp9viKN3D60km+hPD5K/7A4zlkNM89l/GO/J3MeP2XMaT3fFStJVOBBBs5pBB53GhW/X6NYGsuNcLsx0Gr+sjLT5ny+UzvaBRWzeLCpp2S97SQdHjX9/FSqwi01aOVOEoSc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SukPE5n5Mw4adkAW4KPosTc3D21UhzOEW8foC4ht+Sjb8CyaRQgoass3nrRE9s2TLH6uD8FrZrcr3vzSqxRzsOfVR9l5hc9uhyuyk89bFTt+BZNoq5Pi8oppmvIZVRBua1rOBcLSN/C7j9DcKQx+eVkQMeYdpokcxu8kZEfec1tjc6cjromxiyTWVEYHO12csqjO0W4OEYkYeNwcoB49COSl1DVMmwijcIqHv9YzG+WV7W6CzQG2HBR2AYtKTkqDfeOk9XfYAHK9wMZ/EALjqPop2siyxIoagxJwoBUyHM5sb3u0BOW/T6LEFDVOa2R1U5sps4tDYjAL93KRmI+ea6bfkWTaLCysSQiIgCIiA1K6OVwG5kDHA37TQ9jh8JFwfncHktbDqCRssk8zmmRzWstG0sYGtJIvckk9rVYRNz6DR8SYfMySSSmkYGyHNJHI1zmZ7AZmlpBBNhcLYwygMe8e9+eaQgyOtlHAWa1o5NA+6yimyDUhoaqN0u6khyPe+QB7JS4ZuVw8LaxOhdKxln5JWOa+N1szQ8AjiObSCR4oibndijxpqCZ0zJqh7CWBwibG1zWgutmcS4kk2FugWxi1EZojGDa7o3X192Rrv/FZRL5sUbbhwWhQ4YG0raZ/aaGbt+oDhaxRFFsk1Bh9YGbkVDN3bKJMjvWAz65sua3et4Laq8Ma6lfSx9lpjMbOdhlsPqiKXJkUeOPYIKhjbOySN4B443ZcZmOHNpt5gLdropXNG6kDHg37TQ9jgL9kjW3HUHkiJuYo1aCgkEz55nMMhaGARtLWhoJNySSSePgpVERuyTSw+jMe9ub55HSDlYOtw/Ja0eDN9W9Xe6/ae5rx2XNcZHPa5vQi6Im5ij0w/DAylbTSHOMhY82tmBvfh4rWioaxrRE2oZuxwa8sJnDRoNcpdyzW8ERN7tkUTQWURQSEREB//2Q==",
60
+ borderRadius: "rounded-md",
61
+ size: "size-80",
62
+ alternativeText: "image",
63
+ };
64
+ export const ProfileIcon = Template.bind({});
65
+ ProfileIcon.args = {
66
+ 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",
67
+ borderRadius: "rounded-full",
68
+ size: "h-[75px] w-[75px]",
69
+ alternativeText: "profile image",
70
+ };
71
+ export const WithoutImage = Template.bind({});
72
+ WithoutImage.args = {
73
+ imageUrl: "",
74
+ borderRadius: "rounded-full",
75
+ size: "h-14 w-14",
76
+ alternativeText: "",
77
+ userInitials: "AS",
78
+ backgroundColor: "bg-gray-500",
79
+ };
80
+ export const WithInlineBackgroundColor = Template.bind({});
81
+ WithInlineBackgroundColor.args = {
82
+ imageUrl: "",
83
+ borderRadius: "rounded-full",
84
+ size: "h-14 w-14",
85
+ alternativeText: "",
86
+ userInitials: "AS",
87
+ style: { backgroundColor: "hsl(354,94%,74%)" },
88
+ };
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { describe, it, expect, test } from "vitest";
3
+ import { render, screen } 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
+ });
24
+ describe("ImageContainer - inline styles ", () => {
25
+ test("applies inline style BackgroundColor style when provided", () => {
26
+ const inlineBackgroundColor = "rgb(255, 0, 0)";
27
+ render(_jsx(ImageContainer, { imageUrl: "", style: { backgroundColor: inlineBackgroundColor }, borderRadius: "rounded-full", size: "w-10 h-10", userInitials: "AB", additionalClasses: "shadow-md" }));
28
+ const container = screen.getByText("AB").parentElement;
29
+ expect(container).toHaveStyle(`background-color: ${inlineBackgroundColor}`);
30
+ });
31
+ test("does not apply inline style when inlineBackgroundColor is not provided but applies backgroundColor prop", () => {
32
+ const backgroundColor = "bg-blue-500";
33
+ render(_jsx(ImageContainer, { imageUrl: "", backgroundColor: backgroundColor, borderRadius: "rounded-full", size: "w-10 h-10", userInitials: "AB", additionalClasses: "shadow-md" }));
34
+ const container = screen.getByText("AB").parentElement;
35
+ expect(container).not.toHaveStyle(`background-color: ${backgroundColor}`);
36
+ });
37
+ });
38
+ describe("ImageContainer - userInitials", () => {
39
+ test("renders userInitials when imageUrl is not provided", () => {
40
+ render(_jsx(ImageContainer, { imageUrl: "", userInitials: "AB", borderRadius: "rounded-full", size: "w-10 h-10", backgroundColor: "bg-blue-500" }));
41
+ // Assert that user initials are displayed
42
+ const initials = screen.getByText("AB");
43
+ expect(initials).toBeInTheDocument();
44
+ expect(initials).toHaveTextContent("AB");
45
+ });
46
+ test("renders default fallback text when userInitials is not provided", () => {
47
+ render(_jsx(ImageContainer, { imageUrl: "", userInitials: "", borderRadius: "rounded-full", size: "w-10 h-10", backgroundColor: "bg-blue-500" }));
48
+ // Assert that default fallback text is displayed
49
+ const fallbackText = screen.getByText("N/A");
50
+ expect(fallbackText).toBeInTheDocument();
51
+ expect(fallbackText).toHaveTextContent("N/A");
52
+ });
53
+ test("does not render userInitials when imageUrl is provided", () => {
54
+ render(_jsx(ImageContainer, { imageUrl: "https://via.placeholder.com/150", userInitials: "AB", borderRadius: "rounded-full", size: "w-10 h-10", backgroundColor: "bg-blue-500" }));
55
+ // Assert that user initials are not displayed
56
+ const initials = screen.queryByText("AB");
57
+ expect(initials).not.toBeInTheDocument();
58
+ // Assert that the image is displayed instead
59
+ const image = screen.getByRole("img");
60
+ expect(image).toBeInTheDocument();
61
+ expect(image).toHaveAttribute("src", "https://via.placeholder.com/150");
62
+ });
63
+ });
@@ -0,0 +1,11 @@
1
+ export interface ImageContainerProps {
2
+ imageUrl?: string;
3
+ backgroundColor?: string;
4
+ borderRadius?: string;
5
+ size?: string;
6
+ alternativeText?: string;
7
+ userInitials?: string;
8
+ additionalClasses?: string;
9
+ style?: React.CSSProperties;
10
+ imageClasses?: string;
11
+ }
@@ -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 FormButton from "../FormButton/FormButton";
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(FormButton, { 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" })), }) => {
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 FormButton from "../FormButton/FormButton";
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(FormButton, { 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!") })),
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(FormButton, { 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!") })),
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(FormButton, { 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!") })),
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 FormButton from "../FormButton/FormButton";
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(FormButton, { text: "Submit", as: "button", hoverBackground: "green", backgroundColor: "green", icon: getFontAwesomeIcon("arrow-right"), additionalClasses: "items-center px-4", borderColor: "green", hoverFontColor: "black", shape: "cornered" }) }));
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 FormButton from "../FormButton";
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(FormButton, { 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"),
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(FormButton, { 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(FormButton, { 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"),
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 FormButton from "../FormButton";
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(FormButton, { 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" }), ", ]"] }));
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");
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- import { PageSectionTypes } from ".";
2
+ import { PageSectionTypes } from "./PageSection.types";
3
3
  declare const Section: React.FC<PageSectionTypes>;
4
4
  export default Section;
@@ -26,16 +26,16 @@ export default {
26
26
  const Template = (args) => _jsx(Section, { ...args });
27
27
  export const Default = Template.bind({});
28
28
  Default.args = {
29
- 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",
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",
30
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" })] })),
31
31
  };
32
32
  export const HorizontalCardsSection = Template.bind({});
33
33
  HorizontalCardsSection.args = {
34
34
  sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center",
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" }), _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)) })] })),
36
36
  };
37
37
  export const CompassCardsSection = Template.bind({});
38
38
  CompassCardsSection.args = {
39
39
  sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center h-[100%]",
40
- 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: 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
+ 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)) })] })),
41
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
- describe("<Section />", () => {
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("Compass Sales Lenovo TP X13 Yoga G3 Laptop");
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 FormButton from "../FormButton/FormButton";
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(FormButton, { text: buttonText, icon: buttonIcon, iconClasses: buttonIconClasses, as: "button", additionalClasses: buttonClasses, onClick: handleButtonClick }) })] }) })] }) }));
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;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- const Text = ({ size = "text-base", color = "text-black", tag = "span", text, fontFamily = "font-sans", additionalClasses = "", ...props }) => {
2
+ const Text = ({ size = "text-base", color = "text-black", tag = "span", text, fontFamily = "font-sans", additionalClasses = "", style = {}, ...props }) => {
3
3
  const ElementTag = tag;
4
4
  const className = `
5
5
  ${size}
@@ -7,6 +7,6 @@ const Text = ({ size = "text-base", color = "text-black", tag = "span", text, fo
7
7
  ${fontFamily}
8
8
  ${additionalClasses}
9
9
  `;
10
- return (_jsx(ElementTag, { "data-testid": "text", className: className, ...props, children: text }));
10
+ return (_jsx(ElementTag, { "data-testid": "text", className: className, style: style, ...props, children: text }));
11
11
  };
12
12
  export default Text;
@@ -61,6 +61,13 @@ export default {
61
61
  description: "Additional Tailwind CSS classes to be added.",
62
62
  defaultValue: "",
63
63
  },
64
+ style: {
65
+ control: {
66
+ type: "object", // Text input control
67
+ },
68
+ description: "Inline CSS styles to be added.",
69
+ defaultValue: "",
70
+ },
64
71
  },
65
72
  tags: ["autodocs"],
66
73
  parameters: {
@@ -4,7 +4,7 @@ import { describe, expect, beforeEach, test } from "vitest";
4
4
  import Text from "./Text";
5
5
  describe("<Text />", () => {
6
6
  beforeEach(() => {
7
- render(_jsx(Text, { text: "Testing", size: "text-md", color: "text-red-500", tag: "h1", fontFamily: "font-sans" }));
7
+ render(_jsx(Text, { text: "Testing", size: "text-md", color: "text-red-500", tag: "h1", fontFamily: "font-sans", style: { fontSize: "24px" } }));
8
8
  });
9
9
  test("renders Text component", () => {
10
10
  expect(screen.getByTestId("text")).toBeInTheDocument();
@@ -28,4 +28,10 @@ describe("<Text />", () => {
28
28
  const textElement = screen.getByTestId("text");
29
29
  expect(textElement.tagName).toBe("H1");
30
30
  });
31
+ test("applies inline styles correctly", () => {
32
+ const textElement = screen.getByTestId("text");
33
+ expect(textElement).toHaveStyle({
34
+ fontSize: "24px",
35
+ });
36
+ });
31
37
  });
@@ -7,4 +7,5 @@ export interface TextTypes {
7
7
  text: ReactNode;
8
8
  fontFamily?: string;
9
9
  additionalClasses?: string;
10
+ style?: React.CSSProperties;
10
11
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
3
- const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, statusProps = {
3
+ const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, closeIconColor, iconColor, statusProps = {
4
4
  colorClass: "bg-gray-100 border border-gray-500 text-gray-800",
5
5
  icon: { icon: "circleCheck", type: "solid" },
6
6
  }, }) => {
@@ -12,8 +12,8 @@ const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, sta
12
12
  const { colorClass, icon: maybeIcon } = statusProps;
13
13
  const containerClasses = colorClass ?? "";
14
14
  const shadowClasses = `shadow-lg shadow-boxShadow rounded-lg`;
15
- const closeButtonClasses = `cursor-pointer text-xs`;
16
- return (_jsx("div", { "data-testid": "toaster-test-id", role: "alert", "aria-live": "polite", className: `${shadowClasses} ${containerClasses} ${additionalClasses}`, children: message.map((msg, index) => (_jsxs("div", { className: "flex items-center p-2", children: [_jsx("div", { className: "w-6 flex-none mr-2", children: index === 0 && maybeIcon
15
+ const closeButtonClasses = `cursor-pointer text-xs ${closeIconColor}`;
16
+ return (_jsx("div", { "data-testid": "toaster-test-id", role: "alert", "aria-live": "polite", className: `${shadowClasses} ${containerClasses} ${additionalClasses}`, children: message.map((msg, index) => (_jsxs("div", { className: "flex items-center p-2", children: [_jsx("div", { className: `w-6 flex-none mr-2 ${iconColor} `, children: index === 0 && maybeIcon
17
17
  ? getFontAwesomeIcon(maybeIcon.icon, maybeIcon.type)
18
18
  : null }), _jsx("div", { className: "flex-grow", children: _jsx("p", { className: index === 0 && "font-semibold", children: msg }) }), _jsx("div", { className: "w-6 flex-none ml-2", children: index === 0 && hasClearButton && (_jsx("div", { "data-testid": "clear-button", className: closeButtonClasses, onClick: handleClearMessage, children: getFontAwesomeIcon("x", "solid") })) })] }, index))) }));
19
19
  };
@@ -23,6 +23,14 @@ export default {
23
23
  control: "object",
24
24
  description: "Object containing colorClass and optional icon config.",
25
25
  },
26
+ closeIconColor: {
27
+ control: "string",
28
+ description: "Color of the close icon.",
29
+ },
30
+ iconColor: {
31
+ control: "string",
32
+ description: "Color of the icon.",
33
+ },
26
34
  },
27
35
  tags: ["autodocs"],
28
36
  parameters: {
@@ -107,6 +115,8 @@ hasMultipleMessages.args = {
107
115
  clearMessage: () => {
108
116
  alert("Message Cleared!");
109
117
  },
118
+ closeIconColor: "text-orange-400",
119
+ iconColor: "text-orange-400",
110
120
  statusProps: {
111
121
  // Orange variant
112
122
  colorClass: "bg-orange-100 border border-orange-500 text-orange-800",
@@ -11,5 +11,7 @@ export interface ToasterTypes {
11
11
  clearMessage?: React.Dispatch<React.SetStateAction<boolean>>;
12
12
  hasClearButton?: boolean;
13
13
  statusProps?: StatusProps;
14
+ closeIconColor?: string;
15
+ iconColor?: string;
14
16
  }
15
17
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilant/toga-blox",
3
3
  "private": false,
4
- "version": "1.0.29",
4
+ "version": "1.0.30",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",