@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,242 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
3
|
+
import { faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { DUMMYNAVDATA } from "./DUMMYNAVDATA.json";
|
|
5
|
+
import Image from "../Image/Image";
|
|
6
|
+
|
|
7
|
+
import { Accordion } from "../../utils/generateAccordionItem";
|
|
8
|
+
import {
|
|
9
|
+
getParentHoverClassNames,
|
|
10
|
+
getParentHoverTextClassNames,
|
|
11
|
+
getParentStyleClasses,
|
|
12
|
+
getParentTextSizeClasses,
|
|
13
|
+
getParentTextColorClasses,
|
|
14
|
+
getSubmenuClasses,
|
|
15
|
+
getSubmenuHoverClasses,
|
|
16
|
+
getSubmenuTextSizeClasses,
|
|
17
|
+
getSubmenuTextColorClasses,
|
|
18
|
+
getNavBackgroundColor,
|
|
19
|
+
getMobileHiddenBreakpoint,
|
|
20
|
+
getMobileFlexBreakpoint,
|
|
21
|
+
} from "./navClassNames";
|
|
22
|
+
import { NavTypes } from ".";
|
|
23
|
+
|
|
24
|
+
const Nav: React.FC<NavTypes> = ({
|
|
25
|
+
navData = DUMMYNAVDATA,
|
|
26
|
+
navBackgroundColor,
|
|
27
|
+
|
|
28
|
+
parentBackground,
|
|
29
|
+
parentBorderColor,
|
|
30
|
+
parentShape,
|
|
31
|
+
parentTextColor,
|
|
32
|
+
parentTextSize,
|
|
33
|
+
|
|
34
|
+
parentHoverBackground,
|
|
35
|
+
parentHoverFontColor,
|
|
36
|
+
parentHoverUnderline,
|
|
37
|
+
parentHoverBorderColor,
|
|
38
|
+
|
|
39
|
+
submenuBackgroundColor,
|
|
40
|
+
submenuTextColor,
|
|
41
|
+
submenuTextSize,
|
|
42
|
+
|
|
43
|
+
includeSubmenuImages,
|
|
44
|
+
submenuHoverBackground,
|
|
45
|
+
submenuHoverTextColor,
|
|
46
|
+
submenuHoverBorderStyle,
|
|
47
|
+
submenuHoverBorderColor,
|
|
48
|
+
|
|
49
|
+
mobileBreakpoint,
|
|
50
|
+
|
|
51
|
+
accordionParentStyle = "border-b border-black p-2 w-full",
|
|
52
|
+
accordionExpandedStyle = "w-full py-3",
|
|
53
|
+
}) => {
|
|
54
|
+
const [navExpanded, setNavExpanded] = useState<Record<string, boolean>>(
|
|
55
|
+
navData.reduce(
|
|
56
|
+
(acc, _, index) => ({ ...acc, [index.toString()]: false }),
|
|
57
|
+
{}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
let navBackgroundColorClasses = getNavBackgroundColor(navBackgroundColor);
|
|
61
|
+
|
|
62
|
+
let hoverClasses = getParentHoverClassNames(
|
|
63
|
+
parentHoverBackground,
|
|
64
|
+
parentHoverBorderColor
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
let parentHoverTextClasses = getParentHoverTextClassNames(
|
|
68
|
+
parentHoverFontColor,
|
|
69
|
+
parentHoverUnderline
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
let parentStyleClasses = getParentStyleClasses(
|
|
73
|
+
parentBackground,
|
|
74
|
+
parentBorderColor,
|
|
75
|
+
parentShape
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
let parentTextSizeClasses = getParentTextSizeClasses(parentTextSize);
|
|
79
|
+
let parentTextColorClasses = getParentTextColorClasses(parentTextColor);
|
|
80
|
+
|
|
81
|
+
let submenuStyleClasses = getSubmenuClasses(submenuBackgroundColor);
|
|
82
|
+
let submenuHoverClasses = getSubmenuHoverClasses(
|
|
83
|
+
submenuHoverBackground,
|
|
84
|
+
submenuHoverTextColor,
|
|
85
|
+
submenuHoverBorderStyle,
|
|
86
|
+
submenuHoverBorderColor
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
let submenuTextSizeClasses = getSubmenuTextSizeClasses(submenuTextSize);
|
|
90
|
+
let submenuTextColorClasses = getSubmenuTextColorClasses(submenuTextColor);
|
|
91
|
+
|
|
92
|
+
let mobileHiddenBreakpointClasses =
|
|
93
|
+
getMobileHiddenBreakpoint(mobileBreakpoint);
|
|
94
|
+
let mobileFlexBreakpointClasses = getMobileFlexBreakpoint(mobileBreakpoint);
|
|
95
|
+
|
|
96
|
+
const toggleNav = (index: number) => {
|
|
97
|
+
setNavExpanded((prevState) => ({
|
|
98
|
+
...Object.fromEntries(
|
|
99
|
+
Object.keys(prevState).map((key) => [
|
|
100
|
+
key,
|
|
101
|
+
key === index.toString() ? !prevState[key] : false,
|
|
102
|
+
])
|
|
103
|
+
),
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const handleParentClick = (index: number) => {
|
|
108
|
+
toggleNav(index);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const handleKeyDown = (
|
|
112
|
+
event: React.KeyboardEvent<HTMLLIElement | HTMLDivElement>,
|
|
113
|
+
index: number
|
|
114
|
+
) => {
|
|
115
|
+
if (event.key === "Enter") {
|
|
116
|
+
toggleNav(index);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<nav
|
|
122
|
+
className={`flex justify-around ${navBackgroundColorClasses} `}
|
|
123
|
+
data-testid="nav"
|
|
124
|
+
>
|
|
125
|
+
<ul
|
|
126
|
+
className={`flex w-full items-center ${mobileHiddenBreakpointClasses}`}
|
|
127
|
+
aria-label="Main Menu"
|
|
128
|
+
data-testid="main-menu"
|
|
129
|
+
>
|
|
130
|
+
{navData.map((item, index: number) => (
|
|
131
|
+
<div
|
|
132
|
+
className={`flex w-full justify-center`}
|
|
133
|
+
key={item.title}
|
|
134
|
+
>
|
|
135
|
+
{item.to === "" ? (
|
|
136
|
+
<li
|
|
137
|
+
className={`flex w-auto cursor-pointer relative`}
|
|
138
|
+
role="button"
|
|
139
|
+
onClick={() => handleParentClick(index)}
|
|
140
|
+
aria-expanded={navExpanded[index]}
|
|
141
|
+
tabIndex={0}
|
|
142
|
+
onKeyDown={(event) =>
|
|
143
|
+
handleKeyDown(event, index)
|
|
144
|
+
}
|
|
145
|
+
data-testid="parent-menu-item"
|
|
146
|
+
>
|
|
147
|
+
<div
|
|
148
|
+
className={`flex w-full items-center border-2 h-10 ${hoverClasses} ${parentStyleClasses} `}
|
|
149
|
+
data-testid={`parent-button-${item.title}`}
|
|
150
|
+
>
|
|
151
|
+
<div
|
|
152
|
+
className={`flex w-full p-4 justify-between items-center ${parentTextSizeClasses} ${parentTextColorClasses} ${parentHoverTextClasses}`}
|
|
153
|
+
>
|
|
154
|
+
<div className="px-2">{item.title}</div>
|
|
155
|
+
<FontAwesomeIcon
|
|
156
|
+
className={`text-xs transition-transform duration-300 transform ${
|
|
157
|
+
navExpanded[index]
|
|
158
|
+
? "rotate-180"
|
|
159
|
+
: ""
|
|
160
|
+
}`}
|
|
161
|
+
icon={faChevronDown}
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div
|
|
167
|
+
className={`absolute min-w-navDropDown top-16 overflow-x-scroll transition-[max-height] duration-500 ease-in-out ${submenuStyleClasses} ${
|
|
168
|
+
navExpanded[index]
|
|
169
|
+
? "max-h-60"
|
|
170
|
+
: "max-h-0"
|
|
171
|
+
}`}
|
|
172
|
+
aria-hidden={!navExpanded[index]}
|
|
173
|
+
tabIndex={-1}
|
|
174
|
+
>
|
|
175
|
+
<ul className={`w-full `}>
|
|
176
|
+
{item.links.map((link) => (
|
|
177
|
+
<li
|
|
178
|
+
key={link.menuItem}
|
|
179
|
+
className={`flex py-2 border-4 border-transparent w-auto align-center ${submenuStyleClasses} ${submenuHoverClasses} ${submenuTextSizeClasses} ${submenuTextColorClasses}`}
|
|
180
|
+
>
|
|
181
|
+
<a
|
|
182
|
+
href={link.link}
|
|
183
|
+
className="flex hover:underline w-full justify-start items-center pl-1"
|
|
184
|
+
data-testid={link.menuItem}
|
|
185
|
+
tabIndex={
|
|
186
|
+
navExpanded[index]
|
|
187
|
+
? 0
|
|
188
|
+
: -1
|
|
189
|
+
}
|
|
190
|
+
>
|
|
191
|
+
{includeSubmenuImages && (
|
|
192
|
+
<Image
|
|
193
|
+
src={link.src}
|
|
194
|
+
alt={link.alt}
|
|
195
|
+
background={false}
|
|
196
|
+
additionalClasses="w-12 h-12 mr-2"
|
|
197
|
+
data-testid={`submenu-image-${link.menuItem}`}
|
|
198
|
+
/>
|
|
199
|
+
)}
|
|
200
|
+
{link.menuItem}
|
|
201
|
+
</a>
|
|
202
|
+
</li>
|
|
203
|
+
))}
|
|
204
|
+
</ul>
|
|
205
|
+
</div>
|
|
206
|
+
</li>
|
|
207
|
+
) : (
|
|
208
|
+
<li
|
|
209
|
+
className="w-auto"
|
|
210
|
+
onKeyDown={(event) =>
|
|
211
|
+
handleKeyDown(event, index)
|
|
212
|
+
}
|
|
213
|
+
data-testid={`parent-menu-item`}
|
|
214
|
+
>
|
|
215
|
+
<a
|
|
216
|
+
href={item.to}
|
|
217
|
+
className={`flex flex-col p-4 w-full border-2 relative items-center h-10 justify-center ${hoverClasses} ${parentHoverTextClasses} ${parentStyleClasses} ${parentTextSizeClasses} ${parentTextColorClasses}`}
|
|
218
|
+
tabIndex={0}
|
|
219
|
+
data-testid={`parent-link-${item.title}`}
|
|
220
|
+
>
|
|
221
|
+
<div className="px-2">{item.title}</div>
|
|
222
|
+
</a>
|
|
223
|
+
</li>
|
|
224
|
+
)}
|
|
225
|
+
</div>
|
|
226
|
+
))}
|
|
227
|
+
</ul>
|
|
228
|
+
<div
|
|
229
|
+
className={`hidden w-full items-center ${mobileFlexBreakpointClasses}`}
|
|
230
|
+
data-testid="accordion-nav"
|
|
231
|
+
>
|
|
232
|
+
<Accordion
|
|
233
|
+
navData={navData}
|
|
234
|
+
accordionParentStyle={accordionParentStyle}
|
|
235
|
+
accordionExpandedStyle={accordionExpandedStyle}
|
|
236
|
+
/>
|
|
237
|
+
</div>
|
|
238
|
+
</nav>
|
|
239
|
+
);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export default Nav;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DUMMYNAVDATA } from "./DUMMYNAVDATA.json";
|
|
2
|
+
|
|
3
|
+
export interface NavTypes {
|
|
4
|
+
navData?: typeof DUMMYNAVDATA;
|
|
5
|
+
navBackgroundColor?: string;
|
|
6
|
+
|
|
7
|
+
parentHoverBackground?: string;
|
|
8
|
+
parentHoverFontColor?: string;
|
|
9
|
+
parentHoverUnderline?: boolean;
|
|
10
|
+
parentHoverBorderColor?: string;
|
|
11
|
+
|
|
12
|
+
parentBorderColor?: string;
|
|
13
|
+
parentBackground?: string;
|
|
14
|
+
parentShape?: string;
|
|
15
|
+
|
|
16
|
+
parentTextColor?: string;
|
|
17
|
+
parentTextSize?: string;
|
|
18
|
+
parentTextWeight?: string;
|
|
19
|
+
|
|
20
|
+
submenuBackgroundColor?: string;
|
|
21
|
+
submenuTextColor?: string;
|
|
22
|
+
submenuTextSize?: string;
|
|
23
|
+
submenuTextWeight?: string;
|
|
24
|
+
|
|
25
|
+
includeSubmenuImages?: boolean;
|
|
26
|
+
submenuHoverBackground?: string;
|
|
27
|
+
submenuHoverTextColor?: string;
|
|
28
|
+
submenuHoverBorderStyle?: string;
|
|
29
|
+
submenuHoverBorderColor?: string;
|
|
30
|
+
|
|
31
|
+
mobileBreakpoint?: string;
|
|
32
|
+
|
|
33
|
+
accordionParentStyle?: string;
|
|
34
|
+
accordionExpandedStyle?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import classNames from "classNames";
|
|
2
|
+
|
|
3
|
+
export const getNavBackgroundColor = (navBackgroundColor: string | undefined) => {
|
|
4
|
+
return classNames(
|
|
5
|
+
{
|
|
6
|
+
"bg-blue-500": navBackgroundColor === "blue",
|
|
7
|
+
"bg-teal-800": navBackgroundColor === "green",
|
|
8
|
+
":bg-gray-500": navBackgroundColor === "grey",
|
|
9
|
+
":bg-transparent": navBackgroundColor === "none",
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const getParentHoverClassNames = (
|
|
14
|
+
parentHoverBackground: string | undefined,
|
|
15
|
+
parentHoverBorderColor: string | undefined,
|
|
16
|
+
) => {
|
|
17
|
+
return classNames(
|
|
18
|
+
{
|
|
19
|
+
"hover:bg-blue-800": parentHoverBackground === "blue",
|
|
20
|
+
"hover:bg-teal-800": parentHoverBackground === "green",
|
|
21
|
+
"hover:bg-gray-800": parentHoverBackground === "grey",
|
|
22
|
+
"hover:bg-white": parentHoverBackground === "white",
|
|
23
|
+
"hover:bg-transparent text-black": parentHoverBackground === "none",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"hover:border-blue-300": parentHoverBorderColor === "blue",
|
|
27
|
+
"hover:border-teal-300": parentHoverBorderColor === "green",
|
|
28
|
+
"hover:border-gray-300": parentHoverBorderColor === "grey",
|
|
29
|
+
"hover:border-black": parentHoverBorderColor === "black",
|
|
30
|
+
"hover:border-transparent": parentHoverBorderColor === "none",
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export const getParentHoverTextClassNames = (
|
|
38
|
+
parentHoverFontColor: string | undefined,
|
|
39
|
+
parentHoverUnderline: boolean | undefined
|
|
40
|
+
) => {
|
|
41
|
+
return classNames(
|
|
42
|
+
{
|
|
43
|
+
"hover:text-blue-800": parentHoverFontColor === "blue",
|
|
44
|
+
"hover:text-teal-800": parentHoverFontColor === "green",
|
|
45
|
+
"hover:text-slate-100": parentHoverFontColor === "white",
|
|
46
|
+
"hover:text-slate-950": parentHoverFontColor === "black",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"hover:underline hover:underline-offset-4":
|
|
50
|
+
parentHoverUnderline === true,
|
|
51
|
+
"": parentHoverUnderline === false,
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const getParentStyleClasses = (
|
|
57
|
+
parentBackground: string | undefined,
|
|
58
|
+
parentBorderColor: string | undefined,
|
|
59
|
+
parentShape: string | undefined,
|
|
60
|
+
) => {
|
|
61
|
+
return classNames(
|
|
62
|
+
{
|
|
63
|
+
"bg-blue-800": parentBackground === "blue",
|
|
64
|
+
"bg-teal-800": parentBackground === "green",
|
|
65
|
+
"bg-gray-800": parentBackground === "grey",
|
|
66
|
+
"bg-black": parentBackground === "black",
|
|
67
|
+
"bg-white": parentBackground === "white",
|
|
68
|
+
"bg-transparent": parentBackground === "none",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"border-blue-300": parentBorderColor === "blue",
|
|
72
|
+
"border-teal-300": parentBorderColor === "green",
|
|
73
|
+
"border-gray-300": parentBorderColor === "grey",
|
|
74
|
+
"border-black": parentBorderColor === "black",
|
|
75
|
+
"border-transparent": parentBorderColor === "none",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"rounded-none": parentShape === "cornered",
|
|
79
|
+
"rounded-md": parentShape === "semiRounded",
|
|
80
|
+
"rounded-full": parentShape === "rounded",
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
export const getParentTextSizeClasses = (parentTextSize: string | undefined) => {
|
|
87
|
+
return classNames({
|
|
88
|
+
"text-xs": parentTextSize === "xs",
|
|
89
|
+
"text-sm": parentTextSize === "sm",
|
|
90
|
+
"text-md": parentTextSize === "md",
|
|
91
|
+
"text-lg": parentTextSize === "lg",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const getParentTextColorClasses = (parentTextColor: string | undefined) => {
|
|
96
|
+
return classNames({
|
|
97
|
+
"text-slate-100": parentTextColor === "white",
|
|
98
|
+
"text-slate-950": parentTextColor === "black",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const getSubmenuTextSizeClasses = (
|
|
103
|
+
parentTextSize: string | undefined
|
|
104
|
+
) => {
|
|
105
|
+
return classNames({
|
|
106
|
+
"text-xs": parentTextSize === "xs",
|
|
107
|
+
"text-sm": parentTextSize === "sm",
|
|
108
|
+
"text-md": parentTextSize === "md",
|
|
109
|
+
"text-lg": parentTextSize === "lg",
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const getSubmenuTextColorClasses = (submenuTextColor: string | undefined) => {
|
|
114
|
+
return classNames({
|
|
115
|
+
"text-slate-100": submenuTextColor === "white",
|
|
116
|
+
"text-slate-950": submenuTextColor === "black",
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const getSubmenuClasses = (
|
|
121
|
+
submenuBackgroundColor: string | undefined
|
|
122
|
+
) => {
|
|
123
|
+
return classNames(
|
|
124
|
+
{
|
|
125
|
+
"bg-blue-100": submenuBackgroundColor === "blue",
|
|
126
|
+
"bg-teal-100": submenuBackgroundColor === "green",
|
|
127
|
+
"bg-gray-100": submenuBackgroundColor === "grey",
|
|
128
|
+
"bg-white": submenuBackgroundColor === "white",
|
|
129
|
+
"bg-transparent": submenuBackgroundColor === "none",
|
|
130
|
+
},
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const getSubmenuHoverClasses = (
|
|
135
|
+
submenuHoverBackground: string | undefined,
|
|
136
|
+
submenuHoverTextColor: string | undefined,
|
|
137
|
+
submenuHoverBorderStyle: string | undefined,
|
|
138
|
+
submenuHoverBorderColor: string | undefined
|
|
139
|
+
|
|
140
|
+
) => {
|
|
141
|
+
|
|
142
|
+
return classNames(
|
|
143
|
+
{
|
|
144
|
+
"hover:bg-blue-50": submenuHoverBackground === "blue",
|
|
145
|
+
"hover:bg-teal-50": submenuHoverBackground === "green",
|
|
146
|
+
"hover:bg-gray-50": submenuHoverBackground === "grey",
|
|
147
|
+
"hover:bg-white": submenuHoverBackground === "white",
|
|
148
|
+
"hover:bg-transparent": submenuHoverBackground === "none",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"hover:text-slate-100": submenuHoverTextColor === "white",
|
|
152
|
+
"hover:text-slate-950": submenuHoverTextColor === "black",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"hover:border-y-1 border-x-0": submenuHoverBorderStyle === "top-bottom",
|
|
156
|
+
"hover:border-x-1 border-y-0": submenuHoverBorderStyle === "right-left",
|
|
157
|
+
"hover:border-b-1 border-t-0 border-x-0":
|
|
158
|
+
submenuHoverBorderStyle === "bottom",
|
|
159
|
+
"hover:border-transparent": submenuHoverBorderStyle === "none",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"hover:border-blue-600": submenuHoverBorderColor === "blue",
|
|
163
|
+
"hover:border-teal-600 ": submenuHoverBorderColor === "green",
|
|
164
|
+
"hover:border-black": submenuHoverBorderColor === "black",
|
|
165
|
+
"hover:border-transparent ": submenuHoverBorderColor === "none",
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const getMobileHiddenBreakpoint = (mobileBreakpoint: string | undefined) => {
|
|
171
|
+
return classNames({
|
|
172
|
+
"max-sm:hidden": mobileBreakpoint === "small",
|
|
173
|
+
"max-md:hidden": mobileBreakpoint === "medium",
|
|
174
|
+
"max-lg:hidden": mobileBreakpoint === "large",
|
|
175
|
+
"max-xl:hidden": mobileBreakpoint === "extraLarge",
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const getMobileFlexBreakpoint = (
|
|
180
|
+
mobileBreakpoint: string | undefined
|
|
181
|
+
) => {
|
|
182
|
+
return classNames({
|
|
183
|
+
"max-sm:flex max-sm:flex-col": mobileBreakpoint === "small",
|
|
184
|
+
"max-md:flex max-md:flex-col": mobileBreakpoint === "medium",
|
|
185
|
+
"max-lg:flex max-lg:flex-col": mobileBreakpoint === "large",
|
|
186
|
+
"max-xl:flex max-xl:flex-col": mobileBreakpoint === "extraLarge",
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const TableDataDummy: React.FC = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="overflow-x-auto min-w-full">
|
|
6
|
+
<table className="table ">
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th></th>
|
|
10
|
+
<th>Name</th>
|
|
11
|
+
<th>Job</th>
|
|
12
|
+
<th>company</th>
|
|
13
|
+
<th>location</th>
|
|
14
|
+
<th>Last Login</th>
|
|
15
|
+
<th>Favorite Color</th>
|
|
16
|
+
</tr>
|
|
17
|
+
</thead>
|
|
18
|
+
<tbody>
|
|
19
|
+
<tr>
|
|
20
|
+
<th>1</th>
|
|
21
|
+
<td>Cy Ganderton</td>
|
|
22
|
+
<td>Quality Control Specialist</td>
|
|
23
|
+
<td>Littel, Schaden and Vandervort</td>
|
|
24
|
+
<td>Canada</td>
|
|
25
|
+
<td>12/16/2020</td>
|
|
26
|
+
<td>Blue</td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<th>2</th>
|
|
30
|
+
<td>Hart Hagerty</td>
|
|
31
|
+
<td>Desktop Support Technician</td>
|
|
32
|
+
<td>Zemlak, Daniel and Leannon</td>
|
|
33
|
+
<td>United States</td>
|
|
34
|
+
<td>12/5/2020</td>
|
|
35
|
+
<td>Purple</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>3</th>
|
|
39
|
+
<td>Brice Swyre</td>
|
|
40
|
+
<td>Tax Accountant</td>
|
|
41
|
+
<td>Carroll Group</td>
|
|
42
|
+
<td>China</td>
|
|
43
|
+
<td>8/15/2020</td>
|
|
44
|
+
<td>Red</td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<th>4</th>
|
|
48
|
+
<td>Marjy Ferencz</td>
|
|
49
|
+
<td>Office Assistant I</td>
|
|
50
|
+
<td>Rowe-Schoen</td>
|
|
51
|
+
<td>Russia</td>
|
|
52
|
+
<td>3/25/2021</td>
|
|
53
|
+
<td>Crimson</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<th>5</th>
|
|
57
|
+
<td>Yancy Tear</td>
|
|
58
|
+
<td>Community Outreach Specialist</td>
|
|
59
|
+
<td>Wyman-Ledner</td>
|
|
60
|
+
<td>Brazil</td>
|
|
61
|
+
<td>5/22/2020</td>
|
|
62
|
+
<td>Indigo</td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<th>6</th>
|
|
66
|
+
<td>Irma Vasilik</td>
|
|
67
|
+
<td>Editor</td>
|
|
68
|
+
<td>Wiza, Bins and Emard</td>
|
|
69
|
+
<td>Venezuela</td>
|
|
70
|
+
<td>12/8/2020</td>
|
|
71
|
+
<td>Purple</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<th>7</th>
|
|
75
|
+
<td>Meghann Durtnal</td>
|
|
76
|
+
<td>Staff Accountant IV</td>
|
|
77
|
+
<td>Schuster-Schimmel</td>
|
|
78
|
+
<td>Philippines</td>
|
|
79
|
+
<td>2/17/2021</td>
|
|
80
|
+
<td>Yellow</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<th>8</th>
|
|
84
|
+
<td>Sammy Seston</td>
|
|
85
|
+
<td>Accountant I</td>
|
|
86
|
+
<td>O'Hara, Welch and Keebler</td>
|
|
87
|
+
<td>Indonesia</td>
|
|
88
|
+
<td>5/23/2020</td>
|
|
89
|
+
<td>Crimson</td>
|
|
90
|
+
</tr>
|
|
91
|
+
<tr>
|
|
92
|
+
<th>9</th>
|
|
93
|
+
<td>Lesya Tinham</td>
|
|
94
|
+
<td>Safety Technician IV</td>
|
|
95
|
+
<td>Turner-Kuhlman</td>
|
|
96
|
+
<td>Philippines</td>
|
|
97
|
+
<td>2/21/2021</td>
|
|
98
|
+
<td>Maroon</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<th>10</th>
|
|
102
|
+
<td>Zaneta Tewkesbury</td>
|
|
103
|
+
<td>VP Marketing</td>
|
|
104
|
+
<td>Sauer LLC</td>
|
|
105
|
+
<td>Chad</td>
|
|
106
|
+
<td>6/23/2020</td>
|
|
107
|
+
<td>Green</td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<th>11</th>
|
|
111
|
+
<td>Andy Tipple</td>
|
|
112
|
+
<td>Librarian</td>
|
|
113
|
+
<td>Hilpert Group</td>
|
|
114
|
+
<td>Poland</td>
|
|
115
|
+
<td>7/9/2020</td>
|
|
116
|
+
<td>Indigo</td>
|
|
117
|
+
</tr>
|
|
118
|
+
<tr>
|
|
119
|
+
<th>12</th>
|
|
120
|
+
<td>Sophi Biles</td>
|
|
121
|
+
<td>Recruiting Manager</td>
|
|
122
|
+
<td>Gutmann Inc</td>
|
|
123
|
+
<td>Indonesia</td>
|
|
124
|
+
<td>2/12/2021</td>
|
|
125
|
+
<td>Maroon</td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<th>13</th>
|
|
129
|
+
<td>Florida Garces</td>
|
|
130
|
+
<td>Web Developer IV</td>
|
|
131
|
+
<td>Gaylord, Pacocha and Baumbach</td>
|
|
132
|
+
<td>Poland</td>
|
|
133
|
+
<td>5/31/2020</td>
|
|
134
|
+
<td>Purple</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<th>14</th>
|
|
138
|
+
<td>Maribeth Popping</td>
|
|
139
|
+
<td>Analyst Programmer</td>
|
|
140
|
+
<td>Deckow-Pouros</td>
|
|
141
|
+
<td>Portugal</td>
|
|
142
|
+
<td>4/27/2021</td>
|
|
143
|
+
<td>Aquamarine</td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<th>15</th>
|
|
147
|
+
<td>Moritz Dryburgh</td>
|
|
148
|
+
<td>Dental Hygienist</td>
|
|
149
|
+
<td>Schiller, Cole and Hackett</td>
|
|
150
|
+
<td>Sri Lanka</td>
|
|
151
|
+
<td>8/8/2020</td>
|
|
152
|
+
<td>Crimson</td>
|
|
153
|
+
</tr>
|
|
154
|
+
<tr>
|
|
155
|
+
<th>16</th>
|
|
156
|
+
<td>Reid Semiras</td>
|
|
157
|
+
<td>Teacher</td>
|
|
158
|
+
<td>Sporer, Sipes and Rogahn</td>
|
|
159
|
+
<td>Poland</td>
|
|
160
|
+
<td>7/30/2020</td>
|
|
161
|
+
<td>Green</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<th>17</th>
|
|
165
|
+
<td>Alec Lethby</td>
|
|
166
|
+
<td>Teacher</td>
|
|
167
|
+
<td>Reichel, Glover and Hamill</td>
|
|
168
|
+
<td>China</td>
|
|
169
|
+
<td>2/28/2021</td>
|
|
170
|
+
<td>Khaki</td>
|
|
171
|
+
</tr>
|
|
172
|
+
<tr>
|
|
173
|
+
<th>18</th>
|
|
174
|
+
<td>Aland Wilber</td>
|
|
175
|
+
<td>Quality Control Specialist</td>
|
|
176
|
+
<td>Kshlerin, Rogahn and Swaniawski</td>
|
|
177
|
+
<td>Czech Republic</td>
|
|
178
|
+
<td>9/29/2020</td>
|
|
179
|
+
<td>Purple</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<th>19</th>
|
|
183
|
+
<td>Teddie Duerden</td>
|
|
184
|
+
<td>Staff Accountant III</td>
|
|
185
|
+
<td>Pouros, Ullrich and Windler</td>
|
|
186
|
+
<td>France</td>
|
|
187
|
+
<td>10/27/2020</td>
|
|
188
|
+
<td>Aquamarine</td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<th>20</th>
|
|
192
|
+
<td>Lorelei Blackstone</td>
|
|
193
|
+
<td>Data Coordiator</td>
|
|
194
|
+
<td>Witting, Kutch and Greenfelder</td>
|
|
195
|
+
<td>Kazakhstan</td>
|
|
196
|
+
<td>6/3/2020</td>
|
|
197
|
+
<td>Red</td>
|
|
198
|
+
</tr>
|
|
199
|
+
</tbody>
|
|
200
|
+
<tfoot>
|
|
201
|
+
<tr>
|
|
202
|
+
<th></th>
|
|
203
|
+
<th>Name</th>
|
|
204
|
+
<th>Job</th>
|
|
205
|
+
<th>company</th>
|
|
206
|
+
<th>location</th>
|
|
207
|
+
<th>Last Login</th>
|
|
208
|
+
<th>Favorite Color</th>
|
|
209
|
+
</tr>
|
|
210
|
+
</tfoot>
|
|
211
|
+
</table>
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export default TableDataDummy;
|