@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.
Files changed (44) hide show
  1. package/dist/components/Badge/Badge.d.ts +1 -3
  2. package/dist/components/Badge/Badge.js +2 -2
  3. package/dist/components/Badge/Badge.stories.d.ts +1 -1
  4. package/dist/components/Badge/Badge.stories.js +8 -3
  5. package/dist/components/BaseButton/BaseButton.d.ts +4 -0
  6. package/dist/components/BaseButton/BaseButton.js +49 -0
  7. package/dist/components/BaseButton/BaseButton.stories.d.ts +12 -0
  8. package/dist/components/BaseButton/BaseButton.stories.js +200 -0
  9. package/dist/components/BaseButton/BaseButton.test.d.ts +1 -0
  10. package/dist/components/BaseButton/BaseButton.test.js +59 -0
  11. package/dist/components/BaseButton/BaseButton.types.d.ts +24 -0
  12. package/dist/components/BaseButton/BaseButton.types.js +1 -0
  13. package/dist/components/BaseButton/index.d.ts +2 -0
  14. package/dist/components/BaseButton/index.js +2 -0
  15. package/dist/components/Card/DUMMYPRODUCTDATA.json +2 -1
  16. package/dist/components/Card/templates/CounterContentCardTemplate.js +2 -2
  17. package/dist/components/Card/templates/HorizontalCardTemplate.js +3 -3
  18. package/dist/components/Card/templates/ItemCardTemplate.js +2 -2
  19. package/dist/components/Card/templates/KitContentCardTemplate.js +2 -2
  20. package/dist/components/Card/templates/ShippingAddressCardTemplate.js +2 -2
  21. package/dist/components/Card/templates/VerticalCardTemplate.js +2 -2
  22. package/dist/components/CounterButton/CounterButton.js +2 -2
  23. package/dist/components/GenericList/GenericList.js +12 -3
  24. package/dist/components/GetSupport/GetSupport.js +2 -2
  25. package/dist/components/Header/Header.stories.js +3 -3
  26. package/dist/components/ImageContainer/ImageContainer.d.ts +4 -0
  27. package/dist/components/ImageContainer/ImageContainer.js +7 -0
  28. package/dist/components/ImageContainer/ImageContainer.stories.d.ts +6 -0
  29. package/dist/components/ImageContainer/ImageContainer.stories.js +68 -0
  30. package/dist/components/ImageContainer/ImageContainer.test.d.ts +1 -0
  31. package/dist/components/ImageContainer/ImageContainer.test.js +23 -0
  32. package/dist/components/ImageContainer/ImageContainer.types.d.ts +9 -0
  33. package/dist/components/ImageContainer/ImageContainer.types.js +1 -0
  34. package/dist/components/Input/Input.js +2 -2
  35. package/dist/components/Input/Input.stories.js +4 -4
  36. package/dist/components/Input/Input.test.js +2 -2
  37. package/dist/components/Page/ViewPageTemplate.stories.js +3 -3
  38. package/dist/components/Page/ViewPageTemplate.test.js +2 -2
  39. package/dist/components/PageSection/PageSection.d.ts +1 -1
  40. package/dist/components/PageSection/PageSection.stories.js +4 -3
  41. package/dist/components/PageSection/PageSections.test.js +13 -3
  42. package/dist/components/SearchInput/SearchInput.js +2 -2
  43. package/package.json +1 -1
  44. package/dist/main.css +0 -1
@@ -1,6 +1,4 @@
1
1
  import React from "react";
2
2
  import { BadgeTypes } from "./Badge.types";
3
- declare const Badge: React.FC<BadgeTypes & {
4
- styles?: React.CSSProperties;
5
- }>;
3
+ declare const Badge: React.FC<BadgeTypes>;
6
4
  export default Badge;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const Badge = ({ borderColor, borderWidth, borderRadius, backgroundColor, hasMobileStyle, mobileIcon, mobileIconLabel, iconSize, hasLeftIcon, hasRightIcon, icon, image, text, badgeContainerClasses, styles, }) => {
2
+ const Badge = ({ borderColor, borderWidth, borderRadius, backgroundColor, hasMobileStyle, mobileIcon, mobileIconLabel, iconSize, hasLeftIcon, hasRightIcon, icon, image, text, badgeContainerClasses, styles, onClick, }) => {
3
3
  const iconClasses = `${iconSize}`;
4
4
  const badgeBackgroundClasses = `${backgroundColor}`;
5
5
  const badgeBorderClasses = `${borderWidth} ${borderColor} ${borderRadius}`;
6
6
  const badgeClasses = `inline-flex items-center ${badgeBorderClasses} ${badgeBackgroundClasses} ${badgeContainerClasses}`;
7
- return (_jsxs("span", { "data-testid": "badge-test-id", className: badgeClasses, style: styles, children: [image && _jsx("span", { className: "mr-2", children: image }), icon && hasLeftIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden mr-2`, children: icon })), mobileIcon && hasMobileStyle && (_jsx("span", { className: `${iconClasses} hidden max-md:flex max-md:p-0 mr-2`, "aria-hidden": "false", "aria-label": mobileIconLabel, children: mobileIcon })), _jsx("div", { className: `${hasMobileStyle ? "max-md:hidden" : ""}`, children: text }), icon && hasRightIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden ml-2`, children: icon }))] }));
7
+ return (_jsxs("span", { onClick: onClick, "data-testid": "badge-test-id", className: badgeClasses, style: styles, children: [image && _jsx("span", { className: "mr-2", children: image }), icon && hasLeftIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden mr-2`, children: icon })), mobileIcon && hasMobileStyle && (_jsx("span", { className: `${iconClasses} hidden max-md:flex max-md:p-0 mr-2`, "aria-hidden": "false", "aria-label": mobileIconLabel, children: mobileIcon })), _jsx("div", { className: `${hasMobileStyle ? "max-md:hidden" : ""}`, children: text }), icon && hasRightIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden ml-2`, children: icon }))] }));
8
8
  };
9
9
  export default Badge;
@@ -7,4 +7,4 @@ export declare const BadgeWithRightIcon: any;
7
7
  export declare const CommerceBadge: any;
8
8
  export declare const DeskBadge: any;
9
9
  export declare const SupplyBadge: any;
10
- export declare const StylesBadge: any;
10
+ export declare const StylesBadgeWithClick: any;
@@ -122,6 +122,10 @@ export default {
122
122
  control: "none",
123
123
  description: "Sets the inline styles of the badge using direct inline styles",
124
124
  },
125
+ onClick: {
126
+ control: "none",
127
+ description: "Function to be executed when the badge is clicked",
128
+ },
125
129
  },
126
130
  tags: ["autodocs"],
127
131
  parameters: {
@@ -230,8 +234,8 @@ SupplyBadge.parameters = {
230
234
  },
231
235
  },
232
236
  };
233
- export const StylesBadge = Template.bind({});
234
- StylesBadge.args = {
237
+ export const StylesBadgeWithClick = Template.bind({});
238
+ StylesBadgeWithClick.args = {
235
239
  backgroundColor: "bg-gray-300",
236
240
  borderRadius: "rounded-full",
237
241
  badgeContainerClasses: "px-3 py-1",
@@ -239,9 +243,10 @@ StylesBadge.args = {
239
243
  icon: getFontAwesomeIcon("calculator"),
240
244
  hasLeftIcon: true,
241
245
  styles: { background: "#F8F8F9", padding: "1.5rem" },
246
+ onClick: () => alert("Clicked!"),
242
247
  text: (_jsx(Text, { color: "text-black", fontFamily: "font-serif", text: "Closed", tag: "span", size: "text-sm" })),
243
248
  };
244
- StylesBadge.parameters = {
249
+ StylesBadgeWithClick.parameters = {
245
250
  docs: {
246
251
  description: {
247
252
  story: "The badges using the styles prop",
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BaseButtonProps } from "./BaseButton.types";
3
+ declare const BaseButton: React.FC<BaseButtonProps>;
4
+ export default BaseButton;
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const BaseButton = ({ onClick, text, fontFamily, backgroundColor, customWidth, customHeight, shape, borderColor, icon, additionalClasses, type = "button", to, href, isDisabled = false, hasShadow, as: Element = "button", hoverBackground, hoverFontColor, hoverUnderline = false, hoverBorderColor, iconClasses, ...props }) => {
3
+ const baseBaseButtonClasses = "flex items-center justify-center";
4
+ const hoverClasses = !isDisabled
5
+ ? `${hoverBackground} ${hoverFontColor} ${hoverUnderline ? "underline underline-offset-4" : ""} ${hoverBorderColor}`
6
+ : "";
7
+ const buttonColorClasses = `${backgroundColor} ${borderColor}`;
8
+ const cursorClasses = isDisabled
9
+ ? "cursor-not-allowed opacity-50"
10
+ : "cursor-pointer";
11
+ const textStyleClasses = `${fontFamily}`;
12
+ const buttonShapeClasses = shape;
13
+ const buttonClasses = `
14
+ ${baseBaseButtonClasses}
15
+ ${buttonColorClasses}
16
+ ${buttonShapeClasses}
17
+ ${textStyleClasses}
18
+ ${hoverClasses}
19
+ ${cursorClasses}
20
+ ${hasShadow ? "shadow-md" : ""}
21
+ ${customWidth}
22
+ ${customHeight}
23
+ ${additionalClasses}
24
+ `.trim();
25
+ const handleClick = (e) => {
26
+ if (isDisabled) {
27
+ e.preventDefault();
28
+ return;
29
+ }
30
+ onClick?.(e);
31
+ };
32
+ const baseProps = {
33
+ className: buttonClasses,
34
+ onClick: handleClick,
35
+ "aria-disabled": isDisabled ? "true" : "false",
36
+ };
37
+ let ElementProps = { ...baseProps };
38
+ if (Element === "a" && href) {
39
+ ElementProps = { ...baseProps, href };
40
+ }
41
+ else if (Element === "button") {
42
+ ElementProps = { ...baseProps, type };
43
+ }
44
+ else {
45
+ ElementProps = { ...baseProps };
46
+ }
47
+ return (_jsxs(Element, { ...ElementProps, ...props, children: [icon && _jsx("span", { className: iconClasses, children: icon }), text] }));
48
+ };
49
+ export default BaseButton;
@@ -0,0 +1,12 @@
1
+ import { Meta } from "@storybook/react";
2
+ declare const _default: Meta;
3
+ export default _default;
4
+ export declare const Default: any;
5
+ export declare const Compass: any;
6
+ export declare const Disabled: any;
7
+ export declare const WithIcon: any;
8
+ export declare const IconOnly: any;
9
+ export declare const ClearCartButton: any;
10
+ export declare const RightIconButton: any;
11
+ export declare const ConfirmRequestButton: any;
12
+ export declare const FourButtonsRow: any;
@@ -0,0 +1,200 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import BaseButton from "./BaseButton";
3
+ import Text from "../Text/Text";
4
+ import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
5
+ export default {
6
+ title: "Components/BaseButton",
7
+ component: BaseButton,
8
+ argTypes: {
9
+ onClick: {
10
+ table: {
11
+ disable: true,
12
+ },
13
+ control: "none",
14
+ },
15
+ text: {
16
+ control: "none",
17
+ description: "The main text displayed on the button.",
18
+ },
19
+ fontFamily: {
20
+ control: "none",
21
+ description: "The font family of the button text.",
22
+ },
23
+ backgroundColor: {
24
+ control: "none",
25
+ description: "The background color of the button. Use Tailwind CSS color classes.",
26
+ },
27
+ borderColor: {
28
+ control: "none",
29
+ description: "The color of the border of the button. Use Tailwind CSS border color classes.",
30
+ },
31
+ shape: {
32
+ control: "none",
33
+ description: "The shape of the button. Use Tailwind CSS border radius classes.",
34
+ },
35
+ hoverBackground: {
36
+ control: "none",
37
+ description: "The background color of the button on hover. Use Tailwind CSS color classes.",
38
+ },
39
+ hoverFontColor: {
40
+ control: "none",
41
+ description: "The text color of the button on hover. Use Tailwind CSS color classes.",
42
+ },
43
+ hoverUnderline: {
44
+ control: "none",
45
+ description: "Whether the text is underlined on hover.",
46
+ },
47
+ hoverBorderColor: {
48
+ control: "none",
49
+ description: "The border color of the button on hover. Use Tailwind CSS border color classes.",
50
+ },
51
+ isDisabled: {
52
+ control: "none",
53
+ description: "Whether the button is disabled and cannot be clicked.",
54
+ },
55
+ hasShadow: {
56
+ control: "none",
57
+ description: "Tailwind CSS class to add a shadow to the button.",
58
+ },
59
+ customWidth: {
60
+ control: "none",
61
+ description: "Custom width for the button. Can be a Tailwind CSS class.",
62
+ },
63
+ customHeight: {
64
+ control: "none",
65
+ description: "Custom height for the button. Can be a Tailwind CSS class.",
66
+ },
67
+ additionalClasses: {
68
+ control: "none",
69
+ description: "Additional Tailwind CSS classes to apply to the button.",
70
+ },
71
+ icon: {
72
+ control: "none",
73
+ description: "An optional icon element to display inside the button.",
74
+ },
75
+ iconClasses: {
76
+ control: "none",
77
+ description: "Classes for styling the icon inside the button.",
78
+ },
79
+ as: {
80
+ control: "none",
81
+ description: "Defines the type of element to render, such as a 'button', 'a', or a React Router 'Link'.",
82
+ },
83
+ href: {
84
+ control: "none",
85
+ description: "If 'as' is 'a', this specifies the 'href' for an anchor element.",
86
+ },
87
+ to: {
88
+ control: "none",
89
+ description: "If 'as' is 'Link', this specifies the 'to' prop for React Router 'Link'.",
90
+ },
91
+ },
92
+ tags: ["autodocs"],
93
+ parameters: {
94
+ docs: {
95
+ description: {
96
+ component: "The `BaseButton` component is a versatile button component that supports different types of elements like `button`, `a`, and `Link` from React Router. It's highly customizable with Tailwind CSS classes.",
97
+ },
98
+ },
99
+ layout: "centered",
100
+ },
101
+ };
102
+ const Template = (args) => _jsx(BaseButton, { ...args });
103
+ export const Default = Template.bind({});
104
+ Default.args = {
105
+ text: "Default Button",
106
+ backgroundColor: "bg-blue-600",
107
+ fontFamily: "font-sans",
108
+ borderColor: "border-none",
109
+ shape: "rounded-md",
110
+ hoverBackground: "hover:bg-blue-700",
111
+ hoverFontColor: "hover:text-black",
112
+ onClick: () => alert("Button clicked!"),
113
+ additionalClasses: "p-2",
114
+ };
115
+ export const Compass = Template.bind({});
116
+ Compass.args = {
117
+ text: _jsx(Text, { size: "", color: "", text: "Compass Button", fontFamily: "" }),
118
+ backgroundColor: "bg-green-400",
119
+ fontFamily: "font-sans",
120
+ shape: "rounded-md",
121
+ borderColor: "border-none",
122
+ hoverBackground: "hover:bg-green-700",
123
+ hoverFontColor: "hover:text-white",
124
+ hoverBorderColor: "hover:border-green-900",
125
+ hoverUnderline: false,
126
+ onClick: () => alert("Button clicked!"),
127
+ as: "a",
128
+ href: "#",
129
+ additionalClasses: "p-2",
130
+ };
131
+ export const Disabled = Template.bind({});
132
+ Disabled.args = {
133
+ ...Default.args,
134
+ text: _jsx(Text, { size: "", color: "", text: "Disabled Button", fontFamily: "" }),
135
+ isDisabled: true,
136
+ };
137
+ export const WithIcon = Template.bind({});
138
+ WithIcon.args = {
139
+ ...Default.args,
140
+ text: (_jsx(Text, { size: "", color: "", text: "Button with icon", fontFamily: "", additionalClasses: "pl-2" })),
141
+ icon: getFontAwesomeIcon("coffee"),
142
+ shape: "rounded-none",
143
+ hoverUnderline: false,
144
+ onClick: () => alert("Button clicked!"),
145
+ iconClasses: "pl-2",
146
+ };
147
+ export const IconOnly = Template.bind({});
148
+ IconOnly.args = {
149
+ fontFamily: "font-sans",
150
+ shape: "rounded",
151
+ hoverBackground: "hover:bg-gray-100",
152
+ hoverUnderline: false,
153
+ icon: getFontAwesomeIcon("trash"),
154
+ additionalClasses: "flex justify-center items-center px-4 py-3 bg-gray-50",
155
+ onClick: () => alert("Icon button clicked!"),
156
+ };
157
+ export const ClearCartButton = Template.bind({});
158
+ ClearCartButton.args = {
159
+ text: _jsx(Text, { size: "", color: "", text: "Clear Cart", fontFamily: "" }),
160
+ fontFamily: "font-sans",
161
+ shape: "rounded-md",
162
+ hoverBackground: "hover:bg-gray-100",
163
+ hoverFontColor: "hover:text-black",
164
+ hoverBorderColor: "hover:border-red-700",
165
+ hoverUnderline: false,
166
+ icon: getFontAwesomeIcon("trash"),
167
+ iconClasses: "order-first",
168
+ additionalClasses: "px-5 py-6 bg-gray-50 border-red-500 gap-2",
169
+ onClick: () => alert("Cart Cleared!"),
170
+ };
171
+ export const RightIconButton = Template.bind({});
172
+ RightIconButton.args = {
173
+ text: _jsx(Text, { size: "", color: "text-white", text: "Next", fontFamily: "" }),
174
+ backgroundColor: "bg-gray-500",
175
+ shape: "rounded-md",
176
+ hoverBackground: "hover:bg-gray-700",
177
+ hoverFontColor: "hover:text-white",
178
+ hoverBorderColor: "hover:border-blue-700",
179
+ hoverUnderline: false,
180
+ icon: getFontAwesomeIcon("arrowRight"),
181
+ additionalClasses: "px-6 py-3 flex-row-reverse",
182
+ iconClasses: "ml-2 text-white",
183
+ onClick: () => alert("Next clicked!"),
184
+ };
185
+ export const ConfirmRequestButton = Template.bind({});
186
+ ConfirmRequestButton.args = {
187
+ text: _jsx(Text, { size: "", color: "", text: "CONFIRM REQUEST", fontFamily: "" }),
188
+ backgroundColor: "bg-[#9ca3af]",
189
+ fontFamily: "font-sans",
190
+ borderColor: "border-none",
191
+ shape: "rounded-md",
192
+ hoverUnderline: false,
193
+ isDisabled: true,
194
+ additionalClasses: "py-3 px-6",
195
+ };
196
+ export const FourButtonsRow = Template.bind({});
197
+ FourButtonsRow.args = {};
198
+ FourButtonsRow.decorators = [
199
+ (Story) => (_jsxs("div", { className: "flex divide-x divide-gray-200 rounded-md overflow-hidden border border-gray-200", children: [_jsx(BaseButton, { text: "All", backgroundColor: "bg-teal-600", fontFamily: "font-sans", borderColor: "border-gray-200", shape: "rounded-none", hoverUnderline: false, additionalClasses: "py-2 px-4 text-white", onClick: () => alert("All clicked!") }), _jsx(BaseButton, { text: _jsxs(_Fragment, { children: [getFontAwesomeIcon("boxes", "mr-2"), "Bundles"] }), backgroundColor: "bg-white", fontFamily: "font-sans", borderColor: "border-gray-200", shape: "rounded-none", hoverBackground: "hover:bg-teal-600", hoverFontColor: "hover:text-white", hoverBorderColor: "hover:border-none", hoverUnderline: false, additionalClasses: "py-2 px-4", onClick: () => alert("Bundles clicked!") }), _jsx(BaseButton, { text: _jsxs(_Fragment, { children: [getFontAwesomeIcon("clipboard", "mr-2"), "Categories"] }), backgroundColor: "bg-white", fontFamily: "font-sans", borderColor: "border-gray-200", shape: "rounded-none", hoverBackground: "hover:bg-teal-600", hoverFontColor: "hover:text-white", hoverBorderColor: "hover:border-none", hoverUnderline: false, additionalClasses: "py-2 px-4", onClick: () => alert("Categories clicked!") }), _jsx(BaseButton, { text: _jsxs(_Fragment, { children: [getFontAwesomeIcon("plus", "mr-2"), "Custom Categories"] }), backgroundColor: "bg-white", fontFamily: "font-sans", borderColor: "border-gray-200", shape: "rounded-none", hoverBackground: "hover:bg-teal-600", hoverFontColor: "hover:text-white", hoverBorderColor: "hover:border-none", hoverUnderline: false, additionalClasses: "py-2 px-4", onClick: () => alert("Custom Categories clicked!") })] })),
200
+ ];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen, fireEvent } from "@testing-library/react";
3
+ import { describe, expect, test, vi } from "vitest";
4
+ import Button from "./BaseButton";
5
+ import { MemoryRouter } from "react-router-dom";
6
+ import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
7
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
8
+ import { faCheck } from "@fortawesome/free-solid-svg-icons";
9
+ describe("Button", () => {
10
+ test("renders correctly", () => {
11
+ render(_jsx(MemoryRouter, { children: _jsx(Button, { text: "Default Button", backgroundColor: "green", shape: "outline" }) }));
12
+ expect(screen.getByText("Default Button")).toBeInTheDocument();
13
+ });
14
+ test("is clickable", () => {
15
+ const mockOnClick = vi.fn();
16
+ render(_jsx(MemoryRouter, { children: _jsx(Button, { text: "Clickable Button", backgroundColor: "green", shape: "outline", onClick: mockOnClick }) }));
17
+ fireEvent.click(screen.getByText("Clickable Button"));
18
+ expect(mockOnClick).toHaveBeenCalled();
19
+ });
20
+ test("has correct text", () => {
21
+ render(_jsx(MemoryRouter, { children: _jsx(Button, { text: "Default Button", backgroundColor: "green", shape: "outline" }) }));
22
+ expect(screen.getByText("Default Button")).toHaveTextContent("Default Button");
23
+ });
24
+ test("renders the button with an icon", () => {
25
+ const icon = getFontAwesomeIcon("check");
26
+ render(_jsx(Button, { text: "Search Button", icon: _jsx(FontAwesomeIcon, { icon: faCheck }) }));
27
+ const buttonElement = screen.getByText("Search Button");
28
+ expect(buttonElement).toHaveTextContent("Search Button");
29
+ const iconElement = screen.getByRole("img", { hidden: true }); // Search for <svg> with role="img"
30
+ expect(iconElement).toBeInTheDocument();
31
+ });
32
+ });
33
+ describe("Disabled Button", () => {
34
+ test("is disabled", () => {
35
+ render(_jsx(MemoryRouter, { children: _jsx(Button, { text: "Disabled Button", backgroundColor: "green", shape: "outline", isDisabled: true }) }));
36
+ expect(screen.getByText("Disabled Button")).toHaveAttribute("aria-disabled", "true");
37
+ });
38
+ test("handleClick is not triggered when button is disabled", () => {
39
+ const mockOnClick = vi.fn();
40
+ render(_jsx(MemoryRouter, { children: _jsx(Button, { text: "Disabled Button", backgroundColor: "blue", isDisabled: true, onClick: mockOnClick }) }));
41
+ const button = screen.getByText("Disabled Button");
42
+ fireEvent.click(button);
43
+ expect(mockOnClick).not.toHaveBeenCalled();
44
+ });
45
+ });
46
+ describe("Anchor Button", () => {
47
+ test("renders as an anchor tag with correct attributes when Element='a'", () => {
48
+ render(_jsx(Button, { text: "Anchor Button", as: "a", href: "/test-link" }));
49
+ const anchorElement = screen.getByText("Anchor Button");
50
+ expect(anchorElement.tagName).toBe("A");
51
+ expect(anchorElement).toHaveAttribute("href", "/test-link");
52
+ });
53
+ test("renders as an anchor tag without href attribute", () => {
54
+ render(_jsx(Button, { text: "Anchor Button", as: "a" }));
55
+ const anchorElement = screen.getByText("Anchor Button");
56
+ expect(anchorElement.tagName).toBe("A");
57
+ expect(anchorElement).not.toHaveAttribute("href", "/test-link");
58
+ });
59
+ });
@@ -0,0 +1,24 @@
1
+ import React, { ElementType } from "react";
2
+ export interface BaseButtonProps {
3
+ onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
4
+ text?: string | JSX.Element;
5
+ fontFamily?: string;
6
+ backgroundColor?: string;
7
+ borderColor?: string;
8
+ customWidth?: string;
9
+ customHeight?: string;
10
+ shape?: string;
11
+ icon?: JSX.Element | null;
12
+ additionalClasses?: string;
13
+ type?: "button" | "submit" | "reset";
14
+ to?: string;
15
+ href?: string;
16
+ isDisabled?: boolean;
17
+ hasShadow?: string;
18
+ as?: ElementType | string;
19
+ hoverBackground?: string;
20
+ hoverFontColor?: string;
21
+ hoverUnderline?: boolean;
22
+ hoverBorderColor?: string;
23
+ iconClasses?: string;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from "./BaseButton";
2
+ export * from "./BaseButton.types";
@@ -0,0 +1,2 @@
1
+ export { default } from "./BaseButton";
2
+ export * from "./BaseButton.types";
@@ -387,7 +387,8 @@
387
387
  ],
388
388
  "DUMMYCOMPASSPRODUCTDATA": [
389
389
  {
390
- "id": "1 - Environmental Services - Lenovo ThinkPad Universal USB-C Dock",
390
+ "id": "1",
391
+ "title": " Environmental Services - Lenovo ThinkPad Universal USB-C Dock",
391
392
  "rating": 5,
392
393
  "link": "#",
393
394
  "inStock": true,
@@ -5,7 +5,7 @@ import Image from "../../Image/Image";
5
5
  import Badge from "../../Badge/Badge";
6
6
  import CounterButton from "../../CounterButton/CounterButton";
7
7
  import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
8
- import FormButton from "../../FormButton";
8
+ import BaseButton from "../../BaseButton";
9
9
  const truncateDescription = (description, maxLength) => {
10
10
  if (description.length > maxLength) {
11
11
  return description.slice(0, maxLength) + "...";
@@ -41,6 +41,6 @@ const CounterContentCardTemplate = ({ data }) => {
41
41
  setInCart(false);
42
42
  setCount(0);
43
43
  };
44
- return (_jsxs("div", { className: "flex flex-col items-start w-full sm:w-[300px] h-auto sm:h-[350px] border border-[#DFE4EA] bg-white rounded-lg relative p-4 sm:p-4 hover:border-teal-600 hover:shadow-inner", children: [_jsx("div", { className: "absolute top-3 left-3", children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs sm:text-sm" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-green-800" }) }), _jsx("div", { className: "flex justify-center items-center mt-4 w-full", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-[100px] sm:w-[120px] h-[100px] sm:h-[120px] object-contain" }) }), _jsxs("div", { className: "flex flex-col items-start w-full mt-4", children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-md", text: truncateDescription(data.title, 52), color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: `${data.titleProps.additionalClasses} text-left font-bold` }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.identifier, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "text-left mt-1" }), _jsx(Text, { tag: "p", size: "text-xs sm:text-sm", text: truncateDescription(data.description, 52), color: "text-gray-700", fontFamily: "font-sans", additionalClasses: "text-left mt-2" })] }), _jsxs("div", { className: "flex justify-between items-center w-full mt-4 sm:mt-auto", children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-sm sm:text-md", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx("div", { className: "flex items-center gap-2 min-w-[120px] sm:min-w-[150px] justify-end", children: inCart ? (_jsxs(_Fragment, { children: [_jsx(FormButton, { additionalClasses: "w-6 sm:w-8 h-6 sm:h-8 flex items-center justify-center text-red-600", icon: getFontAwesomeIcon("trash"), onClick: handleDeleteClick }), _jsx(CounterButton, { count: count, onIncrementClick: handleIncrementClick, onDecrementClick: handleDecrementClick, onInputChange: handleInputChange, containerClassName: "flex items-center border border-gray-300 rounded-md overflow-hidden", inputClassName: "w-8 h-8 text-center text-xs sm:text-sm border-none outline-none bg-white", buttonClassName: "w-8 h-8 flex items-center justify-center text-gray-600", iconClasses: "fill-current text-gray-600" })] })) : (_jsx(FormButton, { text: "Add to Cart", backgroundColor: "bg-teal-600", shape: "rounded-md", borderColor: "border-none", additionalClasses: "w-[100px] sm:w-[120px] h-[32px] sm:h-[40px] hover:bg-teal-800", onClick: handleAddToCartClick })) })] })] }));
44
+ return (_jsxs("div", { className: "flex flex-col items-start w-full sm:w-[300px] h-auto sm:h-[350px] border border-[#DFE4EA] bg-white rounded-lg relative p-4 sm:p-4 hover:border-teal-600 hover:shadow-inner", children: [_jsx("div", { className: "absolute top-3 left-3", children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs sm:text-sm" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-green-800" }) }), _jsx("div", { className: "flex justify-center items-center mt-4 w-full", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-[100px] sm:w-[120px] h-[100px] sm:h-[120px] object-contain" }) }), _jsxs("div", { className: "flex flex-col items-start w-full mt-4", children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-md", text: truncateDescription(data.title, 52), color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: `${data.titleProps.additionalClasses} text-left font-bold` }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.identifier, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "text-left mt-1" }), _jsx(Text, { tag: "p", size: "text-xs sm:text-sm", text: truncateDescription(data.description, 52), color: "text-gray-700", fontFamily: "font-sans", additionalClasses: "text-left mt-2" })] }), _jsxs("div", { className: "flex justify-between items-center w-full mt-4 sm:mt-auto", children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-sm sm:text-md", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx("div", { className: "flex items-center gap-2 min-w-[120px] sm:min-w-[150px] justify-end", children: inCart ? (_jsxs(_Fragment, { children: [_jsx(BaseButton, { additionalClasses: "w-6 sm:w-8 h-6 sm:h-8 flex items-center justify-center text-red-600", icon: getFontAwesomeIcon("trash"), onClick: handleDeleteClick }), _jsx(CounterButton, { count: count, onIncrementClick: handleIncrementClick, onDecrementClick: handleDecrementClick, onInputChange: handleInputChange, containerClassName: "flex items-center border border-gray-300 rounded-md overflow-hidden", inputClassName: "w-8 h-8 text-center text-xs sm:text-sm border-none outline-none bg-white", buttonClassName: "w-8 h-8 flex items-center justify-center text-gray-600", iconClasses: "fill-current text-gray-600" })] })) : (_jsx(BaseButton, { text: "Add to Cart", backgroundColor: "bg-teal-600", shape: "rounded-md", borderColor: "border-none", additionalClasses: "w-[100px] sm:w-[120px] h-[32px] sm:h-[40px] hover:bg-teal-800", onClick: handleAddToCartClick })) })] })] }));
45
45
  };
46
46
  export default CounterContentCardTemplate;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import FormButton from "../../FormButton/FormButton";
2
+ import BaseButton from "../../BaseButton/BaseButton";
3
3
  import Text from "../../Text/Text";
4
4
  import Image from "../../Image/Image";
5
5
  import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
6
6
  const HorizontalCardTemplate = ({ data }) => {
7
- return (_jsxs(_Fragment, { children: [_jsx("a", { href: "#", className: `flex justify-center w-72 max-sm:w-full`, children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText }) }), _jsxs("div", { className: "flex flex-col justify-between w-3/4 h-full p-3 max-sm:w-full", children: [_jsx("div", { className: "flex h-full mb-12 max-sm:mb-2", children: _jsx("a", { href: data.link, children: _jsx(Text, { tag: data.titleProps.tag, size: data.titleProps.size, text: data.title, color: "black", fontFamily: "", additionalClasses: data.titleProps.additionalClasses }) }) }), _jsxs("div", { className: `flex justify-between mb-12 max-sm:flex-col max-sm:items-end max-sm:mb-2`, children: [_jsx("div", { className: "flex items-center space-x-1 rtl:space-x-reverse max-sm:mb-1", children: _jsx(Text, { tag: data.identifierProps.tag, size: data.identifierProps.size, text: data.identifier, color: "", fontFamily: "", additionalClasses: data.identifierProps.additionalClasses }) }), _jsxs("div", { className: "flex items-center justify-center px-2 max-sm:mb-1", children: [_jsx("div", { className: "pr-2 text-xs", children: data.inStock === true
7
+ return (_jsxs(_Fragment, { children: [_jsx("a", { href: "#", className: `flex justify-center w-72 max-sm:w-full`, "data-testid": "card", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText }) }), _jsxs("div", { className: "flex flex-col justify-between w-3/4 h-full p-3 max-sm:w-full", children: [_jsx("div", { className: "flex h-full mb-12 max-sm:mb-2", children: _jsx("a", { href: data.link, children: _jsx(Text, { tag: data.titleProps.tag, size: data.titleProps.size, text: data.title, color: "black", fontFamily: "", additionalClasses: data.titleProps.additionalClasses }) }) }), _jsxs("div", { className: `flex justify-between mb-12 max-sm:flex-col max-sm:items-end max-sm:mb-2`, children: [_jsx("div", { className: "flex items-center space-x-1 rtl:space-x-reverse max-sm:mb-1", children: _jsx(Text, { tag: data.identifierProps.tag, size: data.identifierProps.size, text: data.identifier, color: "", fontFamily: "", additionalClasses: data.identifierProps.additionalClasses }) }), _jsxs("div", { className: "flex items-center justify-center px-2 max-sm:mb-1", children: [_jsx("div", { className: "pr-2 text-xs", children: data.inStock === true
8
8
  ? getFontAwesomeIcon(data.inStockProps.inStockIcon)
9
9
  : getFontAwesomeIcon(data.inStockProps.outOfStockIcon) }), _jsx(Text, { tag: data.inStockProps.tag, size: data.inStockProps.size, text: data.inStock === true
10
10
  ? "In Stock"
11
- : "Out of Stock", color: "black", fontFamily: "", additionalClasses: data.inStockProps.additionalClasses })] }), _jsxs("div", { className: "flex px-2 items-center space-x-1 rtl:space-x-reverse max-sm:mb-1", children: [_jsx("svg", { className: "w-4 h-4 text-yellow-300", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 22 20", children: _jsx("path", { d: "M20.924 7.625a1.523 1.523 0 0 0-1.238-1.044l-5.051-.734-2.259-4.577a1.534 1.534 0 0 0-2.752 0L7.365 5.847l-5.051.734A1.535 1.535 0 0 0 1.463 9.2l3.656 3.563-.863 5.031a1.532 1.532 0 0 0 2.226 1.616L11 17.033l4.518 2.375a1.534 1.534 0 0 0 2.226-1.617l-.863-5.03L20.537 9.2a1.523 1.523 0 0 0 .387-1.575Z" }) }), _jsx(Text, { tag: data.ratingProps.tag, size: data.ratingProps.size, text: data.rating, color: "", fontFamily: "", additionalClasses: data.ratingProps.additionalClasses })] })] }), _jsxs("div", { className: "flex items-end flex-col w-full max-sm:flex-row max-sm:justify-between", children: [_jsx("div", { className: "px-2", children: _jsx(Text, { tag: data.priceProps.tag, size: data.priceProps.size, text: data.price, color: "black", fontFamily: "", additionalClasses: data.priceProps.additionalClasses }) }), _jsx(FormButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, hoverBackground: data.buttonProps.hoverBackground, additionalClasses: "w-24" })] })] })] }));
11
+ : "Out of Stock", color: "black", fontFamily: "", additionalClasses: data.inStockProps.additionalClasses })] }), _jsxs("div", { className: "flex px-2 items-center space-x-1 rtl:space-x-reverse max-sm:mb-1", children: [_jsx("svg", { className: "w-4 h-4 text-yellow-300", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 22 20", children: _jsx("path", { d: "M20.924 7.625a1.523 1.523 0 0 0-1.238-1.044l-5.051-.734-2.259-4.577a1.534 1.534 0 0 0-2.752 0L7.365 5.847l-5.051.734A1.535 1.535 0 0 0 1.463 9.2l3.656 3.563-.863 5.031a1.532 1.532 0 0 0 2.226 1.616L11 17.033l4.518 2.375a1.534 1.534 0 0 0 2.226-1.617l-.863-5.03L20.537 9.2a1.523 1.523 0 0 0 .387-1.575Z" }) }), _jsx(Text, { tag: data.ratingProps.tag, size: data.ratingProps.size, text: data.rating, color: "", fontFamily: "", additionalClasses: data.ratingProps.additionalClasses })] })] }), _jsxs("div", { className: "flex items-end flex-col w-full max-sm:flex-row max-sm:justify-between", children: [_jsx("div", { className: "px-2", children: _jsx(Text, { tag: data.priceProps.tag, size: data.priceProps.size, text: data.price, color: "black", fontFamily: "", additionalClasses: data.priceProps.additionalClasses }) }), _jsx(BaseButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, hoverBackground: data.buttonProps.hoverBackground, additionalClasses: "w-24" })] })] })] }));
12
12
  };
13
13
  export default HorizontalCardTemplate;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormButton from "../../FormButton/FormButton";
2
+ import BaseButton from "../../BaseButton/BaseButton";
3
3
  import Text from "../../Text/Text";
4
4
  import Image from "../../Image/Image";
5
5
  import Badge from "../../Badge/Badge";
6
6
  const ItemCardTemplate = ({ data, containerClasses = "", imageContainerClasses = "", titleContainerClasses = "", descriptionContainerClasses = "", priceContainerClasses = "", buttonContainerClasses = "", badgeContainerClasses = "", }) => {
7
- return (_jsxs("div", { className: `${containerClasses}`, children: [_jsx("div", { className: badgeContainerClasses, children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs sm:text-sm" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-green-800" }) }), _jsx("div", { className: `flex justify-center items-center ${imageContainerClasses}`, children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "object-contain max-h-full" }) }), _jsxs("div", { className: `${titleContainerClasses}`, children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-sm sm:text-md", text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: data.titleProps.additionalClasses }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.identifier, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "mb-1 sm:mb-2" }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.description, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "mb-2 sm:mb-4" }), _jsxs("div", { className: `${priceContainerClasses}`, children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-sm sm:text-md", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(FormButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: `${buttonContainerClasses} hover:bg-teal-800` })] })] })] }));
7
+ return (_jsxs("div", { className: `${containerClasses}`, children: [_jsx("div", { className: badgeContainerClasses, children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs sm:text-sm" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-green-800" }) }), _jsx("div", { className: `flex justify-center items-center ${imageContainerClasses}`, children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "object-contain max-h-full" }) }), _jsxs("div", { className: `${titleContainerClasses}`, children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-sm sm:text-md", text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: data.titleProps.additionalClasses }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.identifier, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "mb-1 sm:mb-2" }), _jsx(Text, { tag: "span", size: "text-xs sm:text-sm", text: data.description, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "mb-2 sm:mb-4" }), _jsxs("div", { className: `${priceContainerClasses}`, children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-sm sm:text-md", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(BaseButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: `${buttonContainerClasses} hover:bg-teal-800` })] })] })] }));
8
8
  };
9
9
  export default ItemCardTemplate;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormButton from "../../FormButton/FormButton";
2
+ import BaseButton from "../../BaseButton/BaseButton";
3
3
  import Text from "../../Text/Text";
4
4
  import Image from "../../Image/Image";
5
5
  import Badge from "../../Badge/Badge";
6
6
  const KitContentCardTemplate = ({ data }) => {
7
- return (_jsxs("div", { className: "flex flex-col items-start w-full sm:w-[244px] h-auto sm:h-[255px] border border-[#DFE4EA] bg-white rounded-lg relative p-3 hover:border-1 hover:border-teal-600 hover:shadow-inner", children: [_jsx("div", { className: "absolute top-2 left-2", children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-yellow-800" }) }), _jsx("div", { className: "flex flex-col items-center gap-2 mt-6 w-full", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-[80px] h-[80px] sm:w-[100px] sm:h-[100px] object-contain" }) }), _jsxs("div", { className: "flex flex-col items-start w-full mt-2", children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-xs sm:text-sm", text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: `${data.titleProps.additionalClasses} text-left` }), _jsx(Text, { tag: "span", size: "text-xs", text: data.identifier, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "text-left" })] }), _jsxs("div", { className: "flex items-end justify-between w-full mt-auto", children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-xs sm:text-sm", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(FormButton, { text: data.buttonProps.text, backgroundColor: "bg-slate-200", shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: "px-2 py-1 cursor-not-allowed", isDisabled: true })] })] }));
7
+ return (_jsxs("div", { className: "flex flex-col items-start w-full sm:w-[244px] h-auto sm:h-[255px] border border-[#DFE4EA] bg-white rounded-lg relative p-3 hover:border-1 hover:border-teal-600 hover:shadow-inner", children: [_jsx("div", { className: "absolute top-2 left-2", children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-xs" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "text-yellow-800" }) }), _jsx("div", { className: "flex flex-col items-center gap-2 mt-6 w-full", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-[80px] h-[80px] sm:w-[100px] sm:h-[100px] object-contain" }) }), _jsxs("div", { className: "flex flex-col items-start w-full mt-2", children: [_jsx(Text, { tag: data.titleProps.tag, size: "text-xs sm:text-sm", text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: `${data.titleProps.additionalClasses} text-left` }), _jsx(Text, { tag: "span", size: "text-xs", text: data.identifier, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "text-left" })] }), _jsxs("div", { className: "flex items-end justify-between w-full mt-auto", children: [_jsx(Text, { tag: data.priceProps.tag, size: "text-xs sm:text-sm", text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(BaseButton, { text: data.buttonProps.text, backgroundColor: "bg-slate-200", shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: "px-2 py-1 cursor-not-allowed", isDisabled: true })] })] }));
8
8
  };
9
9
  export default KitContentCardTemplate;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormButton from "../../FormButton/FormButton";
2
+ import BaseButton from "../../BaseButton/BaseButton";
3
3
  import Text from "../../Text/Text";
4
4
  import Image from "../../Image/Image";
5
5
  import Badge from "../../Badge/Badge";
6
6
  const ShippingAddressCardTemplate = ({ data, }) => {
7
- return (_jsxs("div", { className: "flex flex-col sm:flex-row p-4 sm:p-6 m-4 sm:m-20 border border-[#00B9A8] bg-white rounded-lg w-full relative hover:border-teal-500 hover:shadow-inner", children: [_jsx("div", { className: "flex-shrink-0 w-full sm:w-auto mb-4 sm:mb-0", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-full h-auto sm:h-auto object-contain" }) }), _jsxs("div", { className: "flex flex-col w-full h-full sm:ml-5", children: [_jsx(Badge, { text: _jsx(Text, { color: "text-green-800", fontFamily: "font-serif", tag: "span", text: data.badgeText, size: "text-xs" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "w-[fit-content] h-[fit-content]" }), _jsxs("div", { className: "mt-2 sm:mt-0", children: [_jsx(Text, { tag: "h2", size: "text-lg", text: data.title, color: "text-black", fontFamily: "font-serif", additionalClasses: "font-bold" }), _jsxs("div", { className: "mt-1", children: [_jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine1, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" }), _jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine2, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" }), _jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine3, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" })] })] }), _jsxs("div", { className: "flex flex-row sm:flex-row gap-2 mt-4 sm:mt-20 w-full sm:w-auto", children: [_jsx(FormButton, { text: "Edit", backgroundColor: "bg-teal-600", shape: "rounded-md", borderColor: "border-none", additionalClasses: "px-2 py-1 sm:px-4 sm:py-2 hover:bg-teal-800" }), _jsx(FormButton, { text: "Delete", backgroundColor: "bg-transparent", shape: "rounded-md", borderColor: "border border-red-600", additionalClasses: "px-2 py-1 sm:px-4 sm:py-2 hover:bg-[#FFEBEE]" })] })] })] }));
7
+ return (_jsxs("div", { className: "flex flex-col sm:flex-row p-4 sm:p-6 m-4 sm:m-20 border border-[#00B9A8] bg-white rounded-lg w-full relative hover:border-teal-500 hover:shadow-inner", children: [_jsx("div", { className: "flex-shrink-0 w-full sm:w-auto mb-4 sm:mb-0", children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-full h-auto sm:h-auto object-contain" }) }), _jsxs("div", { className: "flex flex-col w-full h-full sm:ml-5", children: [_jsx(Badge, { text: _jsx(Text, { color: "text-green-800", fontFamily: "font-serif", tag: "span", text: data.badgeText, size: "text-xs" }), type: "span", hoverColor: "", backgroundColor: "bg-green-100", badgeContainerClasses: "w-[fit-content] h-[fit-content]" }), _jsxs("div", { className: "mt-2 sm:mt-0", children: [_jsx(Text, { tag: "h2", size: "text-lg", text: data.title, color: "text-black", fontFamily: "font-serif", additionalClasses: "font-bold" }), _jsxs("div", { className: "mt-1", children: [_jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine1, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" }), _jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine2, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" }), _jsx(Text, { tag: "span", size: "text-sm", text: data.addressLine3, color: "text-slate-400", fontFamily: "font-sans", additionalClasses: "block" })] })] }), _jsxs("div", { className: "flex flex-row sm:flex-row gap-2 mt-4 sm:mt-20 w-full sm:w-auto", children: [_jsx(BaseButton, { text: "Edit", backgroundColor: "bg-teal-600", shape: "rounded-md", borderColor: "border-none", additionalClasses: "px-2 py-1 sm:px-4 sm:py-2 hover:bg-teal-800" }), _jsx(BaseButton, { text: "Delete", backgroundColor: "bg-transparent", shape: "rounded-md", borderColor: "border border-red-600", additionalClasses: "px-2 py-1 sm:px-4 sm:py-2 hover:bg-[#FFEBEE]" })] })] })] }));
8
8
  };
9
9
  export default ShippingAddressCardTemplate;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormButton from "../../FormButton/FormButton";
2
+ import BaseButton from "../../BaseButton/BaseButton";
3
3
  import Text from "../../Text/Text";
4
4
  import Image from "../../Image/Image";
5
5
  import Badge from "../../Badge/Badge";
6
6
  const VerticalCardTemplate = ({ data, containerClasses = "", imageContainerClasses = "", titleContainerClasses = "", descriptionContainerClasses = "", priceContainerClasses = "", buttonContainerClasses = "", badgeContainerClasses = "", }) => {
7
- return (_jsxs("div", { className: `${containerClasses} p-4`, children: [_jsx("div", { className: badgeContainerClasses, children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-md" }), type: "span", hoverColor: "", badgeContainerClasses: "text-slate-800", backgroundColor: "bg-slate-100" }) }), _jsx("div", { className: `relative ${imageContainerClasses}`, children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-full h-full object-contain" }) }), _jsxs("div", { className: titleContainerClasses, children: [_jsx("div", { className: "flex flex-col", children: _jsx(Text, { tag: data.titleProps.tag, size: data.titleProps.size, text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: data.titleProps.additionalClasses }) }), _jsx("div", { className: descriptionContainerClasses, children: _jsxs("div", { className: "relative flex items-center gap-2", children: [_jsx("div", { className: "w-[30px] h-[30px] rounded-full border border-gray-300 flex items-center justify-center overflow-hidden z-10", children: _jsx(Image, { background: false, src: "../../../assets/compass-card-image-4.png", alt: "Icon 1", additionalClasses: "object-cover w-full h-full" }) }), _jsx("div", { className: "w-[30px] h-[30px] rounded-full border border-gray-300 flex items-center justify-center overflow-hidden -ml-[20px]", children: _jsx(Image, { background: false, src: "../../../assets/compass-card-image-2.png", alt: "Icon 2", additionalClasses: "object-cover w-full h-full" }) }), _jsx(Text, { tag: "span", size: "text-sm", text: data.description, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "ml-4" })] }) }), _jsxs("div", { className: priceContainerClasses, children: [_jsx(Text, { tag: data.priceProps.tag, size: data.priceProps.size, text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(FormButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: buttonContainerClasses })] })] })] }));
7
+ return (_jsxs("div", { className: `${containerClasses} p-4`, children: [_jsx("div", { className: badgeContainerClasses, children: _jsx(Badge, { text: _jsx(Text, { color: "", fontFamily: "font-serif", tag: "p", text: data.badgeText, size: "text-md" }), type: "span", hoverColor: "", badgeContainerClasses: "text-slate-800", backgroundColor: "bg-slate-100" }) }), _jsx("div", { className: `relative ${imageContainerClasses}`, children: _jsx(Image, { background: false, src: data.imageUrl, alt: data.altText, additionalClasses: "w-full h-full object-contain" }) }), _jsxs("div", { className: titleContainerClasses, children: [_jsx("div", { className: "flex flex-col", children: _jsx(Text, { tag: data.titleProps.tag, size: data.titleProps.size, text: data.title, color: data.titleProps.fontColor, fontFamily: data.titleProps.fontFamily, additionalClasses: data.titleProps.additionalClasses }) }), _jsx("div", { className: descriptionContainerClasses, children: _jsxs("div", { className: "relative flex items-center gap-2", children: [_jsx("div", { className: "w-[30px] h-[30px] rounded-full border border-gray-300 flex items-center justify-center overflow-hidden z-10", children: _jsx(Image, { background: false, src: "../../../assets/compass-card-image-4.png", alt: "Icon 1", additionalClasses: "object-cover w-full h-full" }) }), _jsx("div", { className: "w-[30px] h-[30px] rounded-full border border-gray-300 flex items-center justify-center overflow-hidden -ml-[20px]", children: _jsx(Image, { background: false, src: "../../../assets/compass-card-image-2.png", alt: "Icon 2", additionalClasses: "object-cover w-full h-full" }) }), _jsx(Text, { tag: "span", size: "text-sm", text: data.description, color: "text-gray-500", fontFamily: "font-sans", additionalClasses: "ml-4" })] }) }), _jsxs("div", { className: priceContainerClasses, children: [_jsx(Text, { tag: data.priceProps.tag, size: data.priceProps.size, text: data.price, color: data.priceProps.fontColor, fontFamily: data.priceProps.fontFamily, additionalClasses: data.priceProps.additionalClasses }), _jsx(BaseButton, { text: data.buttonProps.text, backgroundColor: data.buttonProps.color, shape: data.buttonProps.shape, borderColor: data.buttonProps.borderColor, additionalClasses: buttonContainerClasses })] })] })] }));
8
8
  };
9
9
  export default VerticalCardTemplate;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormButton from "../FormButton/FormButton";
2
+ import BaseButton from "../BaseButton/BaseButton";
3
3
  import Text from "../Text/Text";
4
4
  const CounterButton = ({ count, containerClassName, inputClassName, buttonClassName, iconClasses, onIncrementClick, onDecrementClick, onInputChange, }) => {
5
- return (_jsxs("div", { className: containerClassName, children: [_jsx(FormButton, { icon: _jsx("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: iconClasses, children: _jsx("path", { d: "M11.0626 6.43135H0.937598C0.712598 6.43135 0.506348 6.24385 0.506348 6.0001C0.506348 5.7751 0.693848 5.56885 0.937598 5.56885H11.0626C11.2876 5.56885 11.4938 5.75635 11.4938 6.0001C11.4938 6.2251 11.2876 6.43135 11.0626 6.43135Z" }) }), text: _jsx(Text, { size: "", color: "", text: "Decrement", fontFamily: "", additionalClasses: "sr-only" }), backgroundColor: "clear", borderColor: "none", shape: "cornered", additionalClasses: buttonClassName, onClick: onDecrementClick }), _jsx("div", { className: `flex justify-center items-center border-x border-gray-300`, children: _jsx("input", { type: "text", value: count, className: inputClassName, onChange: onInputChange, onFocus: (e) => e.target.select() }) }), _jsx(FormButton, { icon: _jsxs("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: iconClasses, children: [_jsx("g", { clipPath: "url(#clip0_1032_24236)", children: _jsx("path", { d: "M11.2501 5.5876H6.43135V0.750098C6.43135 0.525098 6.24385 0.318848 6.0001 0.318848C5.7751 0.318848 5.56885 0.506348 5.56885 0.750098V5.5876H0.750098C0.525098 5.5876 0.318848 5.7751 0.318848 6.01885C0.318848 6.24385 0.506348 6.4501 0.750098 6.4501H5.5876V11.2501C5.5876 11.4751 5.7751 11.6813 6.01885 11.6813C6.24385 11.6813 6.4501 11.4938 6.4501 11.2501V6.43135H11.2501C11.4751 6.43135 11.6813 6.24385 11.6813 6.0001C11.6813 5.7751 11.4751 5.5876 11.2501 5.5876Z" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_1032_24236", children: _jsx("rect", { width: 12, height: 12, fill: "white" }) }) })] }), text: _jsx(Text, { size: "", color: "", text: "Increment", fontFamily: "", additionalClasses: "sr-only" }), backgroundColor: "clear", borderColor: "none", shape: "cornered", additionalClasses: buttonClassName, onClick: onIncrementClick })] }));
5
+ return (_jsxs("div", { className: containerClassName, children: [_jsx(BaseButton, { icon: _jsx("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: iconClasses, children: _jsx("path", { d: "M11.0626 6.43135H0.937598C0.712598 6.43135 0.506348 6.24385 0.506348 6.0001C0.506348 5.7751 0.693848 5.56885 0.937598 5.56885H11.0626C11.2876 5.56885 11.4938 5.75635 11.4938 6.0001C11.4938 6.2251 11.2876 6.43135 11.0626 6.43135Z" }) }), text: _jsx(Text, { size: "", color: "", text: "Decrement", fontFamily: "", additionalClasses: "sr-only" }), backgroundColor: "clear", borderColor: "none", shape: "cornered", additionalClasses: buttonClassName, onClick: onDecrementClick }), _jsx("div", { className: `flex justify-center items-center border-x border-gray-300`, children: _jsx("input", { type: "text", value: count, className: inputClassName, onChange: onInputChange, onFocus: (e) => e.target.select() }) }), _jsx(BaseButton, { icon: _jsxs("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: iconClasses, children: [_jsx("g", { clipPath: "url(#clip0_1032_24236)", children: _jsx("path", { d: "M11.2501 5.5876H6.43135V0.750098C6.43135 0.525098 6.24385 0.318848 6.0001 0.318848C5.7751 0.318848 5.56885 0.506348 5.56885 0.750098V5.5876H0.750098C0.525098 5.5876 0.318848 5.7751 0.318848 6.01885C0.318848 6.24385 0.506348 6.4501 0.750098 6.4501H5.5876V11.2501C5.5876 11.4751 5.7751 11.6813 6.01885 11.6813C6.24385 11.6813 6.4501 11.4938 6.4501 11.2501V6.43135H11.2501C11.4751 6.43135 11.6813 6.24385 11.6813 6.0001C11.6813 5.7751 11.4751 5.5876 11.2501 5.5876Z" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_1032_24236", children: _jsx("rect", { width: 12, height: 12, fill: "white" }) }) })] }), text: _jsx(Text, { size: "", color: "", text: "Increment", fontFamily: "", additionalClasses: "sr-only" }), backgroundColor: "clear", borderColor: "none", shape: "cornered", additionalClasses: buttonClassName, onClick: onIncrementClick })] }));
6
6
  };
7
7
  export default CounterButton;