@agilant/toga-blox 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +9 -0
- package/README.md +69 -0
- package/assets/Logo.png +0 -0
- package/assets/compass-card-image-2.png +0 -0
- package/assets/compass-card-image-3.png +0 -0
- package/assets/compass-card-image-4.png +0 -0
- package/assets/compass-card-image.png +0 -0
- package/assets/compass-logo.png +0 -0
- package/assets/compass-tech-hero-bg.png +0 -0
- package/assets/contact-image.png +0 -0
- package/assets/green-laptop.png +0 -0
- package/assets/heroImage.png +0 -0
- package/assets/placeholder-no-image-available.png +0 -0
- package/assets/team.png +0 -0
- package/declarations.d.ts +4 -0
- package/docker-compose.yml +22 -0
- package/global.css +4 -0
- package/index.js +4 -0
- package/nodemon.json +5 -0
- package/package.json +70 -0
- package/postcss.config.js +6 -0
- package/src/components/Badge/Badge.stories.tsx +284 -0
- package/src/components/Badge/Badge.test.tsx +185 -0
- package/src/components/Badge/Badge.tsx +137 -0
- package/src/components/Badge/Badge.types.tsx +28 -0
- package/src/components/Badge/badgeClassNames.tsx +152 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +91 -0
- package/src/components/Card/Card.test.tsx +53 -0
- package/src/components/Card/Card.tsx +30 -0
- package/src/components/Card/Card.types.ts +11 -0
- package/src/components/Card/DUMMYPRODUCTDATA.json +670 -0
- package/src/components/Card/cardClassNames.ts +49 -0
- package/src/components/Card/index.ts +3 -0
- package/src/components/Card/templates/CompassCardTemplate.tsx +58 -0
- package/src/components/Card/templates/HorizontalCardTemplate.tsx +184 -0
- package/src/components/Card/templates/VerticalCardTemplate.tsx +154 -0
- package/src/components/Footer/ContactInfoItem.tsx +20 -0
- package/src/components/Footer/DUMMYFOOTERDATA.json +132 -0
- package/src/components/Footer/Footer.stories.tsx +292 -0
- package/src/components/Footer/Footer.test.tsx +90 -0
- package/src/components/Footer/Footer.tsx +159 -0
- package/src/components/Footer/Footer.types.tsx +61 -0
- package/src/components/Footer/footerClassNames.tsx +57 -0
- package/src/components/FormButton/FormButton.stories.tsx +199 -0
- package/src/components/FormButton/FormButton.test.tsx +73 -0
- package/src/components/FormButton/FormButton.tsx +116 -0
- package/src/components/FormButton/FormButton.types.ts +32 -0
- package/src/components/FormButton/formButtonClassNames.tsx +153 -0
- package/src/components/FormButton/index.ts +2 -0
- package/src/components/GenericList/DUMMYLISTDATA.json +560 -0
- package/src/components/GenericList/GenericList.stories.tsx +104 -0
- package/src/components/GenericList/GenericList.test.tsx +29 -0
- package/src/components/GenericList/GenericList.tsx +146 -0
- package/src/components/GenericList/genericListClassNames.tsx +8 -0
- package/src/components/GenericList/templates/DummyDataList.tsx +23 -0
- package/src/components/GenericList/templates/DynamicIconList.tsx +74 -0
- package/src/components/HamburgerButton/HamburgerButton.tsx +68 -0
- package/src/components/HamburgerButton/HamburgerButton.types.tsx +6 -0
- package/src/components/HamburgerButton/index.ts +2 -0
- package/src/components/Header/DUMMYICONDATA.json +136 -0
- package/src/components/Header/Header.stories.tsx +521 -0
- package/src/components/Header/Header.test.tsx +323 -0
- package/src/components/Header/Header.tsx +289 -0
- package/src/components/Header/Header.types.ts +52 -0
- package/src/components/Header/headerClassNames.tsx +50 -0
- package/src/components/Header/headerContext.tsx +125 -0
- package/src/components/Header/index.ts +2 -0
- package/src/components/Hero/Hero.stories.tsx +69 -0
- package/src/components/Hero/Hero.test.tsx +109 -0
- package/src/components/Hero/Hero.tsx +58 -0
- package/src/components/Hero/Hero.types.ts +9 -0
- package/src/components/Hero/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +227 -0
- package/src/components/Icon/Icon.test.tsx +53 -0
- package/src/components/Icon/Icon.tsx +208 -0
- package/src/components/Icon/Icon.types.ts +24 -0
- package/src/components/Icon/iconClassNames.ts +79 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Image/Image.stories.tsx +79 -0
- package/src/components/Image/Image.test.tsx +87 -0
- package/src/components/Image/Image.tsx +49 -0
- package/src/components/Image/Image.types.ts +11 -0
- package/src/components/Image/index.ts +2 -0
- package/src/components/Input/Input.stories.tsx +651 -0
- package/src/components/Input/Input.test.tsx +90 -0
- package/src/components/Input/Input.tsx +226 -0
- package/src/components/Input/Input.types.ts +52 -0
- package/src/components/Input/InputMemoTypes.tsx +32 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Input/inputClassNames.tsx +169 -0
- package/src/components/MobileMenu/MobileMenu.tsx +41 -0
- package/src/components/MobileMenu/MobileMenu.types.tsx +30 -0
- package/src/components/MobileMenu/index.ts +2 -0
- package/src/components/Nav/DUMMYNAVDATA.json +234 -0
- package/src/components/Nav/Nav.stories.tsx +181 -0
- package/src/components/Nav/Nav.test.tsx +89 -0
- package/src/components/Nav/Nav.tsx +242 -0
- package/src/components/Nav/Nav.types.tsx +35 -0
- package/src/components/Nav/index.ts +2 -0
- package/src/components/Nav/navClassNames.tsx +192 -0
- package/src/components/Page/TableDataDummy.tsx +216 -0
- package/src/components/Page/ViewPageTemplate.stories.tsx +546 -0
- package/src/components/Page/ViewPageTemplate.test.tsx +361 -0
- package/src/components/Page/ViewPageTemplate.tsx +10 -0
- package/src/components/Page/ViewPageTemplate.types.ts +6 -0
- package/src/components/Page/index.ts +2 -0
- package/src/components/PageSection/PageSection.stories.tsx +114 -0
- package/src/components/PageSection/PageSection.tsx +12 -0
- package/src/components/PageSection/PageSection.types.ts +6 -0
- package/src/components/PageSection/PageSections.test.tsx +88 -0
- package/src/components/PageSection/index.ts +2 -0
- package/src/components/Text/Text.stories.tsx +60 -0
- package/src/components/Text/Text.test.tsx +52 -0
- package/src/components/Text/Text.tsx +80 -0
- package/src/components/Text/Text.types.ts +12 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Toaster/Toaster.stories.tsx +122 -0
- package/src/components/Toaster/Toaster.test.tsx +61 -0
- package/src/components/Toaster/Toaster.tsx +80 -0
- package/src/components/Toaster/Toaster.types.ts +12 -0
- package/src/components/Toaster/index.ts +2 -0
- package/src/hoc/index.ts +2 -0
- package/src/hoc/styling/withStoryBook.tsx +19 -0
- package/src/main.css +3 -0
- package/src/setupTests.ts +1 -0
- package/src/userHoc/index.ts +1 -0
- package/src/userHoc/withMemo.tsx +20 -0
- package/src/utils/assertTagName.tsx +7 -0
- package/src/utils/generateAccordionItem.tsx +102 -0
- package/src/utils/generateFooterContacts.tsx +75 -0
- package/src/utils/generateNavMenu.tsx +54 -0
- package/src/utils/generateSocialList.tsx +34 -0
- package/src/utils/getFontAwesomeIcon.tsx +25 -0
- package/src/utils/inputValidation.tsx +26 -0
- package/tailwind.config.js +32 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +33 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import classNames from "classNames";
|
|
2
|
+
|
|
3
|
+
export const getCardStyleClasses = (
|
|
4
|
+
cardShape: string | undefined,
|
|
5
|
+
cardBorderColor: string | undefined,
|
|
6
|
+
cardBackgroundColor: string | undefined,
|
|
7
|
+
cardBoxShadow: boolean | undefined
|
|
8
|
+
) => {
|
|
9
|
+
return classNames(
|
|
10
|
+
{
|
|
11
|
+
"shadow-md": cardBoxShadow === true,
|
|
12
|
+
"": cardBoxShadow === false,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"rounded-none": cardShape === "cornered",
|
|
16
|
+
"overflow-hidden rounded-md": cardShape === "semiRounded",
|
|
17
|
+
"overflow-hidden rounded-lg": cardShape === "rounded",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"bg-blue-100": cardBackgroundColor === "light blue",
|
|
21
|
+
"bg-teal-100": cardBackgroundColor === "light green",
|
|
22
|
+
"bg-blue-500": cardBackgroundColor === "blue",
|
|
23
|
+
"bg-lime-500": cardBackgroundColor === "lime",
|
|
24
|
+
"bg-teal-500": cardBackgroundColor === "green",
|
|
25
|
+
"bg-yellow-400": cardBackgroundColor === "yellow",
|
|
26
|
+
"bg-orange-500": cardBackgroundColor === "orange",
|
|
27
|
+
"bg-rose-500": cardBackgroundColor === "pink",
|
|
28
|
+
"bg-fuchsia-500": cardBackgroundColor === "fuchsia",
|
|
29
|
+
"bg-purple-500": cardBackgroundColor === "purple",
|
|
30
|
+
"bg-slate-50": cardBackgroundColor === "gray",
|
|
31
|
+
"bg-white": cardBackgroundColor === "white",
|
|
32
|
+
"bg-transparent": cardBackgroundColor === "none",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"border-2 border-blue-500": cardBorderColor === "blue",
|
|
36
|
+
"border-2 border-lime-500": cardBorderColor === "lime",
|
|
37
|
+
"border-2 border-teal-500": cardBorderColor === "green",
|
|
38
|
+
"border-2 border-yellow-400": cardBorderColor === "yellow",
|
|
39
|
+
"border-2 border-orange-500": cardBorderColor === "orange",
|
|
40
|
+
"border-2 border-rose-500": cardBorderColor === "pink",
|
|
41
|
+
"border-2 border-fuchsia-500": cardBorderColor === "fuchsia",
|
|
42
|
+
"border-2 border-purple-500": cardBorderColor === "purple",
|
|
43
|
+
"border-2 border-slate-50": cardBorderColor === "gray",
|
|
44
|
+
"border-2 border-white": cardBorderColor === "white",
|
|
45
|
+
"border-2 border-black": cardBorderColor === "black",
|
|
46
|
+
"border-0 border-transparent": cardBorderColor === "none",
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Text from "../../Text/Text";
|
|
2
|
+
import Image from "../../Image/Image";
|
|
3
|
+
import { TagName } from "../../Text/Text.types";
|
|
4
|
+
|
|
5
|
+
type DataTypes = {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
rating: number;
|
|
9
|
+
link: string;
|
|
10
|
+
linkTitle: boolean;
|
|
11
|
+
imageBackgroundColor: string;
|
|
12
|
+
textBackgroundColor: string;
|
|
13
|
+
titleProps: {
|
|
14
|
+
tag: TagName;
|
|
15
|
+
size: string;
|
|
16
|
+
fontColor: string;
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
additionalClasses: string;
|
|
19
|
+
};
|
|
20
|
+
imageUrl: string | null;
|
|
21
|
+
altText: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const CompassCardTemplate = ({ data }: { data: DataTypes }) => {
|
|
25
|
+
return (
|
|
26
|
+
<a
|
|
27
|
+
href="#"
|
|
28
|
+
className={`flex flex-col justify-center w-full max-sm:w-full h-full`}
|
|
29
|
+
data-testid="card"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
className={data.imageBackgroundColor}
|
|
33
|
+
data-testid="card-image-container"
|
|
34
|
+
>
|
|
35
|
+
<Image
|
|
36
|
+
background={false}
|
|
37
|
+
src={data.imageUrl}
|
|
38
|
+
alt={data.altText}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
data-testid="card-text-container"
|
|
43
|
+
className={`flex flex-col w-full p-2 h-full items-center justify-center max-sm:text-xs ${data.textBackgroundColor}`}
|
|
44
|
+
>
|
|
45
|
+
<Text
|
|
46
|
+
tag={data.titleProps.tag as TagName}
|
|
47
|
+
size={data.titleProps.size}
|
|
48
|
+
text={data.title}
|
|
49
|
+
color={"black"}
|
|
50
|
+
fontFamily={""}
|
|
51
|
+
additionalClasses={data.titleProps.additionalClasses}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
</a>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default CompassCardTemplate;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import FormButton from "../../FormButton/FormButton";
|
|
2
|
+
import Text from "../../Text/Text";
|
|
3
|
+
import Image from "../../Image/Image";
|
|
4
|
+
import { TagName } from "../../Text/Text.types";
|
|
5
|
+
import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
|
|
6
|
+
|
|
7
|
+
type DataTypes = {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
rating: number;
|
|
11
|
+
ratingProps: {
|
|
12
|
+
tag: TagName;
|
|
13
|
+
size: string;
|
|
14
|
+
fontColor: string;
|
|
15
|
+
fontFamily: string;
|
|
16
|
+
additionalClasses: string;
|
|
17
|
+
};
|
|
18
|
+
link: string;
|
|
19
|
+
inStock: boolean;
|
|
20
|
+
inStockProps: {
|
|
21
|
+
tag: TagName;
|
|
22
|
+
size: string;
|
|
23
|
+
fontColor: string;
|
|
24
|
+
fontFamily: string;
|
|
25
|
+
inStockIcon: string;
|
|
26
|
+
outOfStockIcon: string;
|
|
27
|
+
additionalClasses: string;
|
|
28
|
+
};
|
|
29
|
+
linkTitle: boolean;
|
|
30
|
+
identifier: string;
|
|
31
|
+
identifierProps: {
|
|
32
|
+
tag: TagName;
|
|
33
|
+
size: string;
|
|
34
|
+
fontColor: string;
|
|
35
|
+
fontFamily: string;
|
|
36
|
+
additionalClasses: string;
|
|
37
|
+
};
|
|
38
|
+
titleProps: {
|
|
39
|
+
tag: TagName;
|
|
40
|
+
size: string;
|
|
41
|
+
fontColor: string;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
additionalClasses: string;
|
|
44
|
+
};
|
|
45
|
+
price: string;
|
|
46
|
+
priceProps: {
|
|
47
|
+
tag: TagName;
|
|
48
|
+
size: string;
|
|
49
|
+
fontColor: string;
|
|
50
|
+
fontFamily: string;
|
|
51
|
+
additionalClasses: string;
|
|
52
|
+
};
|
|
53
|
+
imageUrl: string | null;
|
|
54
|
+
altText: string;
|
|
55
|
+
buttonProps: {
|
|
56
|
+
text: string;
|
|
57
|
+
as: string;
|
|
58
|
+
size: string;
|
|
59
|
+
fontColor: string;
|
|
60
|
+
borderColor: string;
|
|
61
|
+
shape: string;
|
|
62
|
+
color: string;
|
|
63
|
+
hoverBackground: string;
|
|
64
|
+
additionalClasses: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const HorizontalCardTemplate = ({ data }: { data: DataTypes }) => {
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<a href="#" className={`flex justify-center w-72 max-sm:w-full`}>
|
|
72
|
+
<Image
|
|
73
|
+
background={false}
|
|
74
|
+
src={data.imageUrl}
|
|
75
|
+
alt={data.altText}
|
|
76
|
+
/>
|
|
77
|
+
</a>
|
|
78
|
+
<div className="flex flex-col justify-between w-3/4 h-full p-3 max-sm:w-full">
|
|
79
|
+
<div className="flex h-full mb-12 max-sm:mb-2">
|
|
80
|
+
<a href={data.link}>
|
|
81
|
+
<Text
|
|
82
|
+
tag={data.titleProps.tag as TagName}
|
|
83
|
+
size={data.titleProps.size}
|
|
84
|
+
text={data.title}
|
|
85
|
+
color={"black"}
|
|
86
|
+
fontFamily={""}
|
|
87
|
+
additionalClasses={
|
|
88
|
+
data.titleProps.additionalClasses
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
</a>
|
|
92
|
+
</div>
|
|
93
|
+
<div
|
|
94
|
+
className={`flex justify-between mb-12 max-sm:flex-col max-sm:items-end max-sm:mb-2`}
|
|
95
|
+
>
|
|
96
|
+
<div className="flex items-center space-x-1 rtl:space-x-reverse max-sm:mb-1">
|
|
97
|
+
<Text
|
|
98
|
+
tag={data.identifierProps.tag as TagName}
|
|
99
|
+
size={data.identifierProps.size}
|
|
100
|
+
text={data.identifier}
|
|
101
|
+
color={""}
|
|
102
|
+
fontFamily={""}
|
|
103
|
+
additionalClasses={
|
|
104
|
+
data.identifierProps.additionalClasses
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="flex items-center justify-center px-2 max-sm:mb-1">
|
|
109
|
+
<div className="pr-2 text-xs">
|
|
110
|
+
{data.inStock === true
|
|
111
|
+
? getFontAwesomeIcon(
|
|
112
|
+
data.inStockProps.inStockIcon
|
|
113
|
+
)
|
|
114
|
+
: getFontAwesomeIcon(
|
|
115
|
+
data.inStockProps.outOfStockIcon
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
<Text
|
|
119
|
+
tag={data.inStockProps.tag as TagName}
|
|
120
|
+
size={data.inStockProps.size}
|
|
121
|
+
text={
|
|
122
|
+
data.inStock === true
|
|
123
|
+
? "In Stock"
|
|
124
|
+
: "Out of Stock"
|
|
125
|
+
}
|
|
126
|
+
color={"black"}
|
|
127
|
+
fontFamily={""}
|
|
128
|
+
additionalClasses={
|
|
129
|
+
data.inStockProps.additionalClasses
|
|
130
|
+
}
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
<div className="flex px-2 items-center space-x-1 rtl:space-x-reverse max-sm:mb-1">
|
|
134
|
+
<svg
|
|
135
|
+
className="w-4 h-4 text-yellow-300"
|
|
136
|
+
aria-hidden="true"
|
|
137
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
138
|
+
fill="currentColor"
|
|
139
|
+
viewBox="0 0 22 20"
|
|
140
|
+
>
|
|
141
|
+
<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" />
|
|
142
|
+
</svg>
|
|
143
|
+
<Text
|
|
144
|
+
tag={data.ratingProps.tag as TagName}
|
|
145
|
+
size={data.ratingProps.size}
|
|
146
|
+
text={data.rating}
|
|
147
|
+
color={""}
|
|
148
|
+
fontFamily={""}
|
|
149
|
+
additionalClasses={
|
|
150
|
+
data.ratingProps.additionalClasses
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
<div className="flex items-end flex-col w-full max-sm:flex-row max-sm:justify-between">
|
|
156
|
+
<div className="px-2">
|
|
157
|
+
<Text
|
|
158
|
+
tag={data.priceProps.tag as TagName}
|
|
159
|
+
size={data.priceProps.size}
|
|
160
|
+
text={data.price}
|
|
161
|
+
color={"black"}
|
|
162
|
+
fontFamily={""}
|
|
163
|
+
additionalClasses={
|
|
164
|
+
data.priceProps.additionalClasses
|
|
165
|
+
}
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
<FormButton
|
|
169
|
+
text={data.buttonProps.text}
|
|
170
|
+
color={data.buttonProps.color}
|
|
171
|
+
fontColor={data.buttonProps.fontColor}
|
|
172
|
+
size={data.buttonProps.size}
|
|
173
|
+
shape={data.buttonProps.shape}
|
|
174
|
+
borderColor={data.buttonProps.borderColor}
|
|
175
|
+
hoverBackground={data.buttonProps.hoverBackground}
|
|
176
|
+
additionalClasses="w-24"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export default HorizontalCardTemplate;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import FormButton from "../../FormButton/FormButton";
|
|
2
|
+
import Text from "../../Text/Text";
|
|
3
|
+
import Image from "../../Image/Image";
|
|
4
|
+
import { TagName } from "../../Text/Text.types";
|
|
5
|
+
import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
|
|
6
|
+
|
|
7
|
+
type DataTypes = {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
rating: number;
|
|
11
|
+
link: string;
|
|
12
|
+
inStock: boolean;
|
|
13
|
+
inStockProps: {
|
|
14
|
+
tag: TagName;
|
|
15
|
+
size: string;
|
|
16
|
+
fontColor: string;
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
inStockIcon: string;
|
|
19
|
+
outOfStockIcon: string;
|
|
20
|
+
additionalClasses: string;
|
|
21
|
+
};
|
|
22
|
+
linkTitle: boolean;
|
|
23
|
+
identifier: string;
|
|
24
|
+
titleProps: {
|
|
25
|
+
tag: TagName;
|
|
26
|
+
size: string;
|
|
27
|
+
fontColor: string;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
additionalClasses: string;
|
|
30
|
+
};
|
|
31
|
+
price: string;
|
|
32
|
+
priceProps: {
|
|
33
|
+
tag: TagName;
|
|
34
|
+
size: string;
|
|
35
|
+
fontColor: string;
|
|
36
|
+
fontFamily: string;
|
|
37
|
+
additionalClasses: string;
|
|
38
|
+
};
|
|
39
|
+
imageUrl: string | null;
|
|
40
|
+
altText: string;
|
|
41
|
+
buttonProps: {
|
|
42
|
+
text: string;
|
|
43
|
+
as: string;
|
|
44
|
+
size: string;
|
|
45
|
+
fontColor: string;
|
|
46
|
+
borderColor: string;
|
|
47
|
+
shape: string;
|
|
48
|
+
color: string;
|
|
49
|
+
hoverBackground: string;
|
|
50
|
+
additionalClasses: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const VerticalCardTemplate = ({ data }: { data: DataTypes }) => {
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<a href="#" className={`flex justify-center w-full max-sm:w-full`}>
|
|
58
|
+
<Image
|
|
59
|
+
background={false}
|
|
60
|
+
src={data.imageUrl}
|
|
61
|
+
alt={data.altText}
|
|
62
|
+
/>
|
|
63
|
+
</a>
|
|
64
|
+
<div className="flex flex-col w-full p-2 justify-between">
|
|
65
|
+
<div className="flex h-full mb-8 max-sm:mb-4">
|
|
66
|
+
<a href={data.link}>
|
|
67
|
+
<Text
|
|
68
|
+
tag={data.titleProps.tag as TagName}
|
|
69
|
+
size={data.titleProps.size}
|
|
70
|
+
text={data.title}
|
|
71
|
+
color={"black"}
|
|
72
|
+
fontFamily={""}
|
|
73
|
+
additionalClasses={
|
|
74
|
+
data.titleProps.additionalClasses
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
</a>
|
|
78
|
+
</div>
|
|
79
|
+
<div
|
|
80
|
+
className={`flex w-full items-center justify-between mb-2 max-sm:items-end max-sm:mb-4`}
|
|
81
|
+
>
|
|
82
|
+
|
|
83
|
+
<div className="flex items-center justify-center px-2">
|
|
84
|
+
<div className="pr-2 text-xs">
|
|
85
|
+
{data.inStock === true
|
|
86
|
+
? getFontAwesomeIcon(
|
|
87
|
+
data.inStockProps.inStockIcon
|
|
88
|
+
)
|
|
89
|
+
: getFontAwesomeIcon(
|
|
90
|
+
data.inStockProps.outOfStockIcon
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
<Text
|
|
94
|
+
tag={data.inStockProps.tag as TagName}
|
|
95
|
+
size={data.inStockProps.size}
|
|
96
|
+
text={
|
|
97
|
+
data.inStock === true
|
|
98
|
+
? "In Stock"
|
|
99
|
+
: "Out of Stock"
|
|
100
|
+
}
|
|
101
|
+
color={"black"}
|
|
102
|
+
fontFamily={""}
|
|
103
|
+
additionalClasses={
|
|
104
|
+
data.inStockProps.additionalClasses
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="flex px-2 items-center space-x-1 rtl:space-x-reverse ">
|
|
109
|
+
<svg
|
|
110
|
+
className="w-4 h-4 text-yellow-300"
|
|
111
|
+
aria-hidden="true"
|
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
+
fill="currentColor"
|
|
114
|
+
viewBox="0 0 22 20"
|
|
115
|
+
>
|
|
116
|
+
<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" />
|
|
117
|
+
</svg>
|
|
118
|
+
<span className="bg-white text-blue-800 text-xs font-semibold px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 ms-3">
|
|
119
|
+
{data.rating}
|
|
120
|
+
</span>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<div className={`flex w-full`}>
|
|
124
|
+
<div className="flex items-end flex-col w-full">
|
|
125
|
+
<div className="px-2 mb-2">
|
|
126
|
+
<Text
|
|
127
|
+
tag={data.priceProps.tag as TagName}
|
|
128
|
+
size={data.priceProps.size}
|
|
129
|
+
text={data.price}
|
|
130
|
+
color={"black"}
|
|
131
|
+
fontFamily={""}
|
|
132
|
+
additionalClasses={
|
|
133
|
+
data.priceProps.additionalClasses
|
|
134
|
+
}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
<FormButton
|
|
138
|
+
text={data.buttonProps.text}
|
|
139
|
+
color={data.buttonProps.color}
|
|
140
|
+
fontColor={data.buttonProps.fontColor}
|
|
141
|
+
size={data.buttonProps.size}
|
|
142
|
+
shape={data.buttonProps.shape}
|
|
143
|
+
borderColor={data.buttonProps.borderColor}
|
|
144
|
+
hoverBackground={data.buttonProps.hoverBackground}
|
|
145
|
+
additionalClasses="w-24"
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default VerticalCardTemplate;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
+
|
|
5
|
+
interface ContactInfoItemProps {
|
|
6
|
+
icon: IconDefinition;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ContactInfoItem: React.FC<ContactInfoItemProps> = ({
|
|
11
|
+
icon,
|
|
12
|
+
children,
|
|
13
|
+
}) => (
|
|
14
|
+
<div className="flex w-full space-between pb-3">
|
|
15
|
+
<div className="flex w-[10%] my-1">
|
|
16
|
+
<FontAwesomeIcon icon={icon} />
|
|
17
|
+
</div>
|
|
18
|
+
<div className="my-1">{children}</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DUMMYCONTACTDATA": [
|
|
3
|
+
{
|
|
4
|
+
"id": "1",
|
|
5
|
+
"address": "3 Seaview Boulevard",
|
|
6
|
+
"city": "Port Washington",
|
|
7
|
+
"state": "NY 11050",
|
|
8
|
+
"googleLink": "https://maps.app.goo.gl/kyLZNYZHfyKxSnSH8",
|
|
9
|
+
"phone": "217.472.0953",
|
|
10
|
+
"email": "generic-company@email.com"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"DUMMYNAVDATA": [
|
|
14
|
+
{
|
|
15
|
+
"id": "1",
|
|
16
|
+
"title": "About",
|
|
17
|
+
"link": "#",
|
|
18
|
+
"links": [
|
|
19
|
+
{
|
|
20
|
+
"menuItem": "Features",
|
|
21
|
+
"link": "#"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"menuItem": "Pricing",
|
|
25
|
+
"link": "#"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"menuItem": "Support",
|
|
29
|
+
"link": "#"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"menuItem": "Forums",
|
|
33
|
+
"link": "#"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": 2,
|
|
39
|
+
"title": "Projects",
|
|
40
|
+
"links": [
|
|
41
|
+
{
|
|
42
|
+
"menuItem": "Contribute",
|
|
43
|
+
"link": "#"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"menuItem": "Media assets",
|
|
47
|
+
"link": "#"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"menuItem": "Changelog",
|
|
51
|
+
"link": "#"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"menuItem": "Releases",
|
|
55
|
+
"link": "#"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": 3,
|
|
61
|
+
"title": "Community",
|
|
62
|
+
"links": [
|
|
63
|
+
{
|
|
64
|
+
"menuItem": "Join Discord",
|
|
65
|
+
"link": "#"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"menuItem": "Follow on Twitter",
|
|
69
|
+
"link": "#"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"menuItem": "Email newsletter",
|
|
73
|
+
"link": "#"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"menuItem": "GitHub discussions",
|
|
77
|
+
"link": "#"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": 4,
|
|
83
|
+
"title": "Store",
|
|
84
|
+
"links": [
|
|
85
|
+
{
|
|
86
|
+
"menuItem": "Computers",
|
|
87
|
+
"link": "#"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"menuItem": "IpadsIpads",
|
|
91
|
+
"link": "#"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"menuItem": "Accessories",
|
|
95
|
+
"link": "#"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"title": "Extra Row",
|
|
101
|
+
"links": [
|
|
102
|
+
{
|
|
103
|
+
"menuItem": "One submenu",
|
|
104
|
+
"link": "#"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"DUMMYSOCIALDATA": [
|
|
110
|
+
{
|
|
111
|
+
"type": "Twitter",
|
|
112
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
113
|
+
"path": "M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z",
|
|
114
|
+
"ariaLabel": "Twitter",
|
|
115
|
+
"href": "https://twitter.com/"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "YouTube",
|
|
119
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
120
|
+
"path": "M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z",
|
|
121
|
+
"ariaLabel": "YouTube",
|
|
122
|
+
"href": "https://youtube.com/"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "Facebook",
|
|
126
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
127
|
+
"path": "M9 8h-3v4h3v12h5v-12h3.642l.358-4h-4v-1.667c0-.955.192-1.333 1.115-1.333h2.885v-5h-3.808c-3.596 0-5.192 1.583-5.192 4.615v3.385z",
|
|
128
|
+
"ariaLabel": "Facebook",
|
|
129
|
+
"href": "https://facebook.com/"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|