@bikiran/utils 1.18.0
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/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/components/Profile/LoginBtn.d.ts +8 -0
- package/dist/components/Profile/LoginBtn.js +13 -0
- package/dist/components/Profile/ProfileManage.d.ts +12 -0
- package/dist/components/Profile/ProfileManage.js +45 -0
- package/dist/components/Profile/ProfileMenuList.d.ts +5 -0
- package/dist/components/Profile/ProfileMenuList.js +32 -0
- package/dist/components/Profile/ProfileMenuPopup.d.ts +12 -0
- package/dist/components/Profile/ProfileMenuPopup.js +26 -0
- package/dist/components/Profile/ProfileUserInformation.d.ts +8 -0
- package/dist/components/Profile/ProfileUserInformation.js +9 -0
- package/dist/components/Profile/ProfileView.d.ts +14 -0
- package/dist/components/Profile/ProfileView.js +9 -0
- package/dist/components/Profile/authTypes.d.ts +21 -0
- package/dist/components/Profile/authTypes.js +1 -0
- package/dist/components/Profile/authTypes.ts +22 -0
- package/dist/components/Profile/icons.d.ts +9 -0
- package/dist/components/Profile/icons.js +33 -0
- package/dist/components/Profile/style/LoginBtn.module.css +6 -0
- package/dist/components/Profile/style/ProfileManage.module.css +6 -0
- package/dist/components/Profile/style/ProfileMenuList.module.css +50 -0
- package/dist/components/Profile/style/ProfileMenuPopup.module.css +30 -0
- package/dist/components/Profile/style/ProfileUserInformation.module.css +26 -0
- package/dist/components/Profile/style/ProfileView.module.css +12 -0
- package/dist/components/button-wrapper/ButtonWrapper.d.ts +14 -0
- package/dist/components/button-wrapper/ButtonWrapper.js +11 -0
- package/dist/components/button-wrapper/icons/icon.d.ts +1 -0
- package/dist/components/button-wrapper/icons/icon.js +4 -0
- package/dist/components/button-wrapper/style/style.module.css +18 -0
- package/dist/components/cookie-accept-popup/CookiesAcceptPopup.d.ts +2 -0
- package/dist/components/cookie-accept-popup/CookiesAcceptPopup.js +28 -0
- package/dist/components/cookie-accept-popup/style/CookieAcceptPopup.module.css +12 -0
- package/dist/components/copy-wrapper/CopyWrapper.d.ts +6 -0
- package/dist/components/copy-wrapper/CopyWrapper.js +9 -0
- package/dist/components/copy-wrapper/icon/icons.d.ts +2 -0
- package/dist/components/copy-wrapper/icon/icons.js +7 -0
- package/dist/components/currency-selector/CurrencySelector.d.ts +14 -0
- package/dist/components/currency-selector/CurrencySelector.js +47 -0
- package/dist/components/currency-selector/style/CurrencySelector.module.css +28 -0
- package/dist/components/custom-sidebar/CustomSidebar.d.ts +15 -0
- package/dist/components/custom-sidebar/CustomSidebar.js +29 -0
- package/dist/components/custom-sidebar/icons.d.ts +3 -0
- package/dist/components/custom-sidebar/icons.js +7 -0
- package/dist/components/custom-sidebar/style/CustomSidebar.module.css +21 -0
- package/dist/components/filter-wrapper/FilterBarWrapper.d.ts +12 -0
- package/dist/components/filter-wrapper/FilterBarWrapper.js +85 -0
- package/dist/components/filter-wrapper/SearchInput.d.ts +10 -0
- package/dist/components/filter-wrapper/SearchInput.js +8 -0
- package/dist/components/filter-wrapper/icons/Icons.d.ts +2 -0
- package/dist/components/filter-wrapper/icons/Icons.js +7 -0
- package/dist/components/filter-wrapper/style/FilterBarWrapper.module.css +41 -0
- package/dist/components/header/FixedHeaderControl.d.ts +7 -0
- package/dist/components/header/FixedHeaderControl.js +23 -0
- package/dist/components/header/HeaderLoginColumnComp.d.ts +25 -0
- package/dist/components/header/HeaderLoginColumnComp.js +36 -0
- package/dist/components/header/HeaderLogoComp.d.ts +6 -0
- package/dist/components/header/HeaderLogoComp.js +6 -0
- package/dist/components/header/HeaderSection.d.ts +21 -0
- package/dist/components/header/HeaderSection.js +27 -0
- package/dist/components/header/HeaderServiceBtnComp.d.ts +10 -0
- package/dist/components/header/HeaderServiceBtnComp.js +17 -0
- package/dist/components/header/HeaderToggleMenuComp.d.ts +9 -0
- package/dist/components/header/HeaderToggleMenuComp.js +16 -0
- package/dist/components/header/NavbarComp.d.ts +11 -0
- package/dist/components/header/NavbarComp.js +46 -0
- package/dist/components/header/header.css +61 -0
- package/dist/components/header/headerType.d.ts +14 -0
- package/dist/components/header/headerType.js +1 -0
- package/dist/components/header/headerType.ts +15 -0
- package/dist/components/header/icons/icon-about-us-submenu.svg +6 -0
- package/dist/components/header/icons/icon-about-us.svg +5 -0
- package/dist/components/header/icons/icon-all-service.svg +11 -0
- package/dist/components/header/icons/icon-arrow-v2.svg +3 -0
- package/dist/components/header/icons/icon-bell-fill.svg +3 -0
- package/dist/components/header/icons/icon-bik-logo.svg +13 -0
- package/dist/components/header/icons/icon-contacts.svg +6 -0
- package/dist/components/header/icons/icon-domain.svg +4 -0
- package/dist/components/header/icons/icon-hosting.svg +5 -0
- package/dist/components/header/icons/icon-our-clients.svg +4 -0
- package/dist/components/header/icons/icons.d.ts +14 -0
- package/dist/components/header/icons/icons.js +27 -0
- package/dist/components/header/sidebar/SidebarConstants.d.ts +0 -0
- package/dist/components/header/sidebar/SidebarConstants.js +55 -0
- package/dist/components/header/sidebar/SidebarConstants.ts +55 -0
- package/dist/components/header/sidebar/SidebarIcons.d.ts +5 -0
- package/dist/components/header/sidebar/SidebarIcons.js +9 -0
- package/dist/components/header/sidebar/SidebarMenu.d.ts +12 -0
- package/dist/components/header/sidebar/SidebarMenu.js +28 -0
- package/dist/components/header/sidebar/SidebarMenuRow.d.ts +10 -0
- package/dist/components/header/sidebar/SidebarMenuRow.js +32 -0
- package/dist/components/header/sidebar/SidebarSubMenu.d.ts +9 -0
- package/dist/components/header/sidebar/SidebarSubMenu.js +14 -0
- package/dist/components/header/sidebar/SidebarTopRow.d.ts +0 -0
- package/dist/components/header/sidebar/SidebarTopRow.js +100 -0
- package/dist/components/header/sidebar/sidebarStyle.css +32 -0
- package/dist/components/information-tooltip/InformationTooltip.d.ts +11 -0
- package/dist/components/information-tooltip/InformationTooltip.js +27 -0
- package/dist/components/information-tooltip/icons.d.ts +6 -0
- package/dist/components/information-tooltip/icons.js +10 -0
- package/dist/components/information-tooltip/style/InfoTooltip.module.css +62 -0
- package/dist/components/loading-comp/LoadingComp.d.ts +2 -0
- package/dist/components/loading-comp/LoadingComp.js +7 -0
- package/dist/components/loading-comp/style/LoadingComp.module.css +3 -0
- package/dist/components/pageLoading/PageLoading.d.ts +2 -0
- package/dist/components/pageLoading/PageLoading.js +6 -0
- package/dist/components/pageLoading/style/PageLoading.module.css +7 -0
- package/dist/components/pagination2/Pagination.d.ts +18 -0
- package/dist/components/pagination2/Pagination.js +40 -0
- package/dist/components/pagination2/style/Pagination.module.css +27 -0
- package/dist/components/project-selector/ProjectListBody.d.ts +9 -0
- package/dist/components/project-selector/ProjectListBody.js +10 -0
- package/dist/components/project-selector/ProjectListPopup.d.ts +12 -0
- package/dist/components/project-selector/ProjectListPopup.js +31 -0
- package/dist/components/project-selector/ProjectSelector.d.ts +11 -0
- package/dist/components/project-selector/ProjectSelector.js +38 -0
- package/dist/components/project-selector/ProjectSelectorSkeleton.d.ts +3 -0
- package/dist/components/project-selector/ProjectSelectorSkeleton.js +6 -0
- package/dist/components/project-selector/ProjectServiceTabs.d.ts +0 -0
- package/dist/components/project-selector/ProjectServiceTabs.js +28 -0
- package/dist/components/project-selector/ProjectServices.d.ts +3 -0
- package/dist/components/project-selector/ProjectServices.js +12 -0
- package/dist/components/project-selector/SelectorMainComp.d.ts +8 -0
- package/dist/components/project-selector/SelectorMainComp.js +6 -0
- package/dist/components/project-selector/projectConstants.d.ts +2 -0
- package/dist/components/project-selector/projectConstants.js +20 -0
- package/dist/components/project-selector/projectConstants.ts +23 -0
- package/dist/components/project-selector/projectTypes.d.ts +22 -0
- package/dist/components/project-selector/projectTypes.js +1 -0
- package/dist/components/project-selector/projectTypes.ts +22 -0
- package/dist/components/project-selector/selector-icons/icon-arrow-down.svg +3 -0
- package/dist/components/project-selector/selector-icons/icon-default-app.svg +9 -0
- package/dist/components/project-selector/selector-icons/selectorIcons.d.ts +4 -0
- package/dist/components/project-selector/selector-icons/selectorIcons.js +6 -0
- package/dist/components/services-popup/ServiceAppType.d.ts +9 -0
- package/dist/components/services-popup/ServiceAppType.js +1 -0
- package/dist/components/services-popup/ServiceAppType.ts +10 -0
- package/dist/components/services-popup/ServicesPopup.d.ts +19 -0
- package/dist/components/services-popup/ServicesPopup.js +35 -0
- package/dist/components/services-popup/components/AppAccount.d.ts +7 -0
- package/dist/components/services-popup/components/AppAccount.js +8 -0
- package/dist/components/services-popup/components/ServiceApp.d.ts +8 -0
- package/dist/components/services-popup/components/ServiceApp.js +6 -0
- package/dist/components/services-popup/icons/Icons.d.ts +5 -0
- package/dist/components/services-popup/icons/Icons.js +8 -0
- package/dist/components/services-popup/icons/icon-account.svg +7 -0
- package/dist/components/services-popup/icons/icon-cross.svg +3 -0
- package/dist/components/services-popup/icons/icon-default-app.svg +9 -0
- package/dist/components/user-info/TooltipUserInfo.d.ts +8 -0
- package/dist/components/user-info/TooltipUserInfo.js +29 -0
- package/dist/components/user-info/UserInfoComp.d.ts +8 -0
- package/dist/components/user-info/UserInfoComp.js +7 -0
- package/dist/components/user-info/icons/icons.d.ts +1 -0
- package/dist/components/user-info/icons/icons.js +4 -0
- package/dist/components/user-info/style/ToolTipUserInfo.module.css +28 -0
- package/dist/declaration.d.ts +9 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +15 -0
- package/dist/index.ts +15 -0
- package/dist/lib/Skeleton.d.ts +4 -0
- package/dist/lib/Skeleton.js +18 -0
- package/dist/lib/types/GlobalType.d.ts +9 -0
- package/dist/lib/types/GlobalType.js +1 -0
- package/dist/lib/types/GlobalType.ts +17 -0
- package/dist/lib/utils/Cookie.d.ts +11 -0
- package/dist/lib/utils/Cookie.js +46 -0
- package/dist/lib/utils/Cookie.ts +58 -0
- package/dist/lib/utils/Copy.d.ts +5 -0
- package/dist/lib/utils/Copy.js +32 -0
- package/dist/lib/utils/Copy.ts +37 -0
- package/dist/lib/utils/Env.d.ts +35 -0
- package/dist/lib/utils/Env.js +190 -0
- package/dist/lib/utils/Env.ts +236 -0
- package/dist/lib/utils/capitalizeFirstLetter.d.ts +2 -0
- package/dist/lib/utils/capitalizeFirstLetter.js +7 -0
- package/dist/lib/utils/capitalizeFirstLetter.ts +7 -0
- package/dist/lib/utils/cn.d.ts +2 -0
- package/dist/lib/utils/cn.js +3 -0
- package/dist/lib/utils/cn.ts +4 -0
- package/dist/lib/utils/option.d.ts +10 -0
- package/dist/lib/utils/option.js +6 -0
- package/dist/lib/utils/option.ts +7 -0
- package/dist/package.json +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import SidebarSubMenu from "./SidebarSubMenu";
|
|
5
|
+
import { sidebarIcons } from "./SidebarIcons";
|
|
6
|
+
import { cn } from "../../../lib/utils/cn";
|
|
7
|
+
const SidebarMenuRow = ({ listArr, closeMenu, ImageComponent, routerFn, }) => {
|
|
8
|
+
const [openL1, setOpenL1] = useState(0);
|
|
9
|
+
const router = routerFn();
|
|
10
|
+
const onMenuClick = (menu) => {
|
|
11
|
+
var _a;
|
|
12
|
+
if (((_a = menu === null || menu === void 0 ? void 0 : menu.subMenu) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
13
|
+
if (openL1 === (menu === null || menu === void 0 ? void 0 : menu.id)) {
|
|
14
|
+
setOpenL1(0);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setOpenL1(menu === null || menu === void 0 ? void 0 : menu.id);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
router.push(menu === null || menu === void 0 ? void 0 : menu.path);
|
|
21
|
+
closeMenu();
|
|
22
|
+
};
|
|
23
|
+
return (_jsx("ul", { className: "p-4 pr-8 space-y-4", children: listArr === null || listArr === void 0 ? void 0 : listArr.map((menu) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return (_jsxs("li", { children: [_jsxs("button", { type: "button", className: "flex items-center justify-between w-full", onClick: () => onMenuClick(menu), children: [_jsxs("div", { className: "flex items-center gap-3.5", children: [_jsx("div", { className: "w-9", children: _jsx(ImageComponent, { src: menu === null || menu === void 0 ? void 0 : menu.icon, alt: "menu", width: 0, height: 0, sizes: "100vw", className: "w-full h-auto" }) }), _jsx("div", { className: "text-base font-normal", children: menu === null || menu === void 0 ? void 0 : menu.title })] }), ((_a = menu === null || menu === void 0 ? void 0 : menu.subMenu) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (_jsx("div", { className: cn("w-2 transition-all duration-200", {
|
|
26
|
+
"opacity-0": true,
|
|
27
|
+
"rotate-90": (menu === null || menu === void 0 ? void 0 : menu.id) === openL1,
|
|
28
|
+
"opacity-100": ((_b = menu === null || menu === void 0 ? void 0 : menu.subMenu) === null || _b === void 0 ? void 0 : _b.length) > 0,
|
|
29
|
+
}), children: _jsx(ImageComponent, { src: sidebarIcons.iconArrowRight, alt: "arrow", width: 0, height: 0, sizes: "100vw", className: "w-full h-auto" }) })) : null] }), _jsx(SidebarSubMenu, { show: openL1 === (menu === null || menu === void 0 ? void 0 : menu.id), ImageComponent: ImageComponent, subMenu: menu === null || menu === void 0 ? void 0 : menu.subMenu, closeMenu: closeMenu, routerFn: routerFn })] }, menu === null || menu === void 0 ? void 0 : menu.id));
|
|
30
|
+
}) }));
|
|
31
|
+
};
|
|
32
|
+
export default SidebarMenuRow;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../../lib/utils/cn";
|
|
4
|
+
const SidebarSubMenu = ({ show, subMenu, closeMenu, ImageComponent, routerFn, }) => {
|
|
5
|
+
const router = routerFn();
|
|
6
|
+
const onSubMenuClick = (menu) => {
|
|
7
|
+
router.push(menu === null || menu === void 0 ? void 0 : menu.path);
|
|
8
|
+
closeMenu();
|
|
9
|
+
};
|
|
10
|
+
return (_jsx("ul", { className: cn("sidebar_menu_submenu", {
|
|
11
|
+
active: show,
|
|
12
|
+
}), children: subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((menu) => (_jsx("li", { children: _jsx("button", { type: "button", className: "flex items-center justify-between w-full", onClick: () => onSubMenuClick(menu), children: _jsxs("div", { className: "flex items-center gap-3.5", children: [_jsx("div", { className: "w-[24px]", children: _jsx(ImageComponent, { src: menu === null || menu === void 0 ? void 0 : menu.icon, alt: "menu", width: 0, height: 0, sizes: "100vw", className: "w-full h-auto" }) }), _jsx("div", { className: "text-sm font-normal", children: menu === null || menu === void 0 ? void 0 : menu.title })] }) }) }, menu === null || menu === void 0 ? void 0 : menu.id))) }));
|
|
13
|
+
};
|
|
14
|
+
export default SidebarSubMenu;
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// "use client";
|
|
3
|
+
// import Image from "next/image";
|
|
4
|
+
// import { icons } from "@/bikiran/lib/icons";
|
|
5
|
+
// import { basic } from "@/bikiran/utils/Images";
|
|
6
|
+
// import { cn } from "@/bik-lib/utils/cn";
|
|
7
|
+
// import { useAuth2 } from "@/bik-lib/context/auth/Auth2Provider";
|
|
8
|
+
// import React from "react";
|
|
9
|
+
// type TButtonPrimary = {
|
|
10
|
+
// title: string;
|
|
11
|
+
// className: string;
|
|
12
|
+
// onClick: any;
|
|
13
|
+
// variant: string;
|
|
14
|
+
// };
|
|
15
|
+
// const ButtonPrimary: React.FC<TButtonPrimary> = ({
|
|
16
|
+
// title,
|
|
17
|
+
// className,
|
|
18
|
+
// onClick,
|
|
19
|
+
// variant = "outline",
|
|
20
|
+
// }) => {
|
|
21
|
+
// return (
|
|
22
|
+
// <button
|
|
23
|
+
// type="button"
|
|
24
|
+
// className={cn(
|
|
25
|
+
// "rounded-[7px] py-2.5 px-7 text-base font-medium",
|
|
26
|
+
// className,
|
|
27
|
+
// {
|
|
28
|
+
// "bg-secondary text-white": variant === "fill",
|
|
29
|
+
// "bg-secondary-100 text-secondary": variant === "outline",
|
|
30
|
+
// }
|
|
31
|
+
// )}
|
|
32
|
+
// onClick={onClick}
|
|
33
|
+
// >
|
|
34
|
+
// <span>{title}</span>
|
|
35
|
+
// </button>
|
|
36
|
+
// );
|
|
37
|
+
// };
|
|
38
|
+
// function Body() {
|
|
39
|
+
// const { authInfo: currentUser } = useAuth2();
|
|
40
|
+
// // if (!currentUser?.loginStatus) {
|
|
41
|
+
// // return (
|
|
42
|
+
// // <div className="flex justify-center items-end">
|
|
43
|
+
// // <ButtonPrimary
|
|
44
|
+
// // variant=""
|
|
45
|
+
// // title="Login"
|
|
46
|
+
// // // onClick={() => makeAction('sign-in')}
|
|
47
|
+
// // onClick={null}
|
|
48
|
+
// // className="py-2 px-14"
|
|
49
|
+
// // />
|
|
50
|
+
// // </div>
|
|
51
|
+
// // );
|
|
52
|
+
// // }
|
|
53
|
+
// return (
|
|
54
|
+
// <div className="sidebar_user_info">
|
|
55
|
+
// <div className="size-10">
|
|
56
|
+
// <Image
|
|
57
|
+
// src={basic.imgAvatar}
|
|
58
|
+
// alt="Avatar"
|
|
59
|
+
// width={0}
|
|
60
|
+
// height={0}
|
|
61
|
+
// sizes="100vw"
|
|
62
|
+
// className="size-full rounded-full"
|
|
63
|
+
// />
|
|
64
|
+
// </div>
|
|
65
|
+
// {/* <div>
|
|
66
|
+
// <h3 className="user_name">
|
|
67
|
+
// {currentUser?.displayName || <span>[Not Set]</span>}
|
|
68
|
+
// </h3>
|
|
69
|
+
// <p className="user_email">
|
|
70
|
+
// {currentUser?.email || <span>[Not Set]</span>}
|
|
71
|
+
// </p>
|
|
72
|
+
// </div> */}
|
|
73
|
+
// </div>
|
|
74
|
+
// );
|
|
75
|
+
// }
|
|
76
|
+
// type TSidebarTopRow = {
|
|
77
|
+
// closeMenu: any;
|
|
78
|
+
// };
|
|
79
|
+
// const SidebarTopRow: React.FC<TSidebarTopRow> = ({ closeMenu }) => {
|
|
80
|
+
// return (
|
|
81
|
+
// <div className="relative pl-5 pt-18 pb-4 border-b border-primary-100">
|
|
82
|
+
// <button
|
|
83
|
+
// type="button"
|
|
84
|
+
// className="block w-8 absolute top-4 left-4"
|
|
85
|
+
// onClick={closeMenu}
|
|
86
|
+
// >
|
|
87
|
+
// <Image
|
|
88
|
+
// src={icons.iconBack}
|
|
89
|
+
// alt="arrow"
|
|
90
|
+
// width={0}
|
|
91
|
+
// height={0}
|
|
92
|
+
// sizes="100vw"
|
|
93
|
+
// className="w-full h-auto"
|
|
94
|
+
// />
|
|
95
|
+
// </button>
|
|
96
|
+
// <Body />
|
|
97
|
+
// </div>
|
|
98
|
+
// );
|
|
99
|
+
// };
|
|
100
|
+
// export default SidebarTopRow;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.sidebar_menu_wrapper {
|
|
2
|
+
@apply fixed top-0 -left-full z-[60] size-full bg-[#20202082] transition-all duration-300;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.sidebar_menu_wrapper.active {
|
|
6
|
+
@apply left-0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.sidebar_menu {
|
|
10
|
+
@apply w-[300px] h-full bg-white relative;
|
|
11
|
+
}
|
|
12
|
+
ul.sidebar_menu_submenu {
|
|
13
|
+
@apply pl-12 overflow-hidden transition-all duration-200;
|
|
14
|
+
}
|
|
15
|
+
ul.sidebar_menu_submenu li {
|
|
16
|
+
@apply flex items-center h-[42px] max-h-0 opacity-0 overflow-hidden transition-all duration-200;
|
|
17
|
+
}
|
|
18
|
+
ul.sidebar_menu_submenu.active li {
|
|
19
|
+
@apply max-h-[42px] opacity-100 overflow-hidden transition-all duration-200;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sidebar_user_info {
|
|
23
|
+
@apply flex items-center gap-4;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sidebar_user_info .user_name {
|
|
27
|
+
@apply text-primary text-base font-bold;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sidebar_user_info .user_email {
|
|
31
|
+
@apply text-primary-300 text-xs font-medium;
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
type TProps = {
|
|
3
|
+
content: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
align?: "left" | "right" | "top" | "bottom";
|
|
7
|
+
fillColor?: string;
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const InformationTooltip: FC<TProps>;
|
|
11
|
+
export default InformationTooltip;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconArrow, IconInfo } from "./icons";
|
|
3
|
+
import styles from "./style/InfoTooltip.module.css";
|
|
4
|
+
import { cn } from "../../lib/utils/cn";
|
|
5
|
+
const InformationTooltip = ({ children, content, className, align = "right", fillColor = "#FFF9DB", borderColor = "#FFE6BA", }) => {
|
|
6
|
+
const tooltipClass = cn(styles.tooltipContent, align === "top"
|
|
7
|
+
? styles.topAlign
|
|
8
|
+
: align === "bottom"
|
|
9
|
+
? styles.bottomAlign
|
|
10
|
+
: align === "left"
|
|
11
|
+
? styles.leftAlign
|
|
12
|
+
: styles.rightAlign, className);
|
|
13
|
+
const arrowClass = cn(styles.arrow, align === "top"
|
|
14
|
+
? styles.arrowTop
|
|
15
|
+
: align === "bottom"
|
|
16
|
+
? styles.arrowBottom
|
|
17
|
+
: align === "left"
|
|
18
|
+
? styles.arrowLeft
|
|
19
|
+
: styles.arrowRight);
|
|
20
|
+
return (_jsxs("div", { className: styles.wrapper, children: [children ? children : _jsx(IconInfo, {}), _jsx("div", { className: tooltipClass, style: {
|
|
21
|
+
backgroundColor: fillColor,
|
|
22
|
+
borderColor: borderColor,
|
|
23
|
+
borderWidth: "1px",
|
|
24
|
+
color: "var(--color-primary)", // if you have text-primary color in css vars
|
|
25
|
+
}, children: _jsx("span", { children: content }) }), _jsx("div", { className: arrowClass, children: _jsx(IconArrow, { fillColor: fillColor, borderColor: borderColor }) })] }));
|
|
26
|
+
};
|
|
27
|
+
export default InformationTooltip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const IconArrow = ({ fillColor, borderColor, }) => {
|
|
3
|
+
return (_jsxs("svg", { version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 27.001 10.473", style: { enableBackground: "new 0 0 27.001 10.473" }, children: [_jsx("style", { type: "text/css", children: `
|
|
4
|
+
.st0 { fill: ${fillColor}; }
|
|
5
|
+
.st1 { fill: ${borderColor}; }
|
|
6
|
+
` }), _jsx("path", { className: "st0", d: "M27,0v1h-1.04c-1.18,0-2.49,0.45-3.71,1.21C21.03,2.97,19.96,4,19.24,5.06l-1.1,1.63\n c-0.74,1.08-1.35,1.98-1.91,2.6C15.98,9.56,15.7,9.81,15.4,10c-0.4,0.27-0.86,0.44-1.4,0.44s-1-0.17-1.4-0.44\n c-0.3-0.19-0.58-0.44-0.83-0.71c-0.56-0.62-1.17-1.52-1.91-2.6l-1.1-1.63C8.04,4,6.97,2.97,5.75,2.21C4.53,1.45,3.22,1,2.04,1H0V0\n H27z" }), _jsx("path", { className: "st1", d: "M27,0v1h-1.04c-1.18,0-2.49,0.45-3.71,1.21C21.03,2.97,19.96,4,19.24,5.06l-1.1,1.63\n c-0.74,1.08-1.35,1.98-1.91,2.6C15.98,9.56,15.7,9.81,15.4,10c-0.4,0.27-0.86,0.44-1.4,0.44s-1-0.17-1.4-0.44\n c-0.3-0.19-0.58-0.44-0.83-0.71c-0.56-0.62-1.17-1.52-1.91-2.6l-1.1-1.63C8.04,4,6.97,2.97,5.75,2.21C4.53,1.45,3.22,1,2.04,1H0V0\n h2.04c1.03,0,2.11,0.29,3.13,0.76C6.94,1.59,8.56,3,9.58,4.5h0.01l1.1,1.63c1.5,2.21,2.25,3.31,3.31,3.31\n c0.53,0,0.98-0.28,1.49-0.83s1.07-1.37,1.82-2.48l1.11-1.63c1.02-1.5,2.64-2.91,4.41-3.74C23.85,0.29,24.93,0,25.96,0H27z" })] }));
|
|
7
|
+
};
|
|
8
|
+
export const IconInfo = () => {
|
|
9
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 50 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M20.278 23.8507C20.3772 23.4536 20.4568 23.1005 20.5583 22.7535C20.581 22.677 20.6689 22.5914 20.7462 22.5641C22.1608 22.061 23.5504 21.4693 25.109 21.5632C26.4365 21.6428 27.6555 22.4368 27.864 23.6211C27.9934 24.3606 27.9466 25.1781 27.7768 25.9138C27.3926 27.577 26.8691 29.2083 26.4319 30.86C26.3084 31.3282 26.2531 31.8215 26.2273 32.3063C26.1902 33.0049 26.4917 33.3633 27.1858 33.4945C27.9087 33.631 28.6147 33.5384 29.3028 33.2847C29.3491 33.2673 29.3998 33.2626 29.5126 33.2376C29.4148 33.6181 29.337 33.9575 29.2355 34.2893C29.2134 34.3622 29.1179 34.4371 29.0406 34.4636C28.1846 34.76 27.3411 35.1252 26.4615 35.3189C25.2097 35.5948 23.9535 35.5903 22.8253 34.812C22.004 34.2454 21.6509 33.4611 21.7039 32.4746C21.7994 30.7009 22.5086 29.0771 22.9291 27.3822C23.1375 26.5427 23.3504 25.6941 23.4383 24.8364C23.536 23.8847 23.0344 23.4423 22.0555 23.4764C21.7592 23.487 21.4622 23.5347 21.1713 23.5953C20.8864 23.6559 20.6091 23.7544 20.278 23.8507Z", fill: "#130F40" }), _jsx("path", { d: "M26.0834 14.56C27.5344 14.5562 28.6209 15.6594 28.5951 17.074C28.5762 18.1098 27.8639 19.0076 26.8161 19.3175C25.6629 19.6577 24.3741 19.0902 23.8748 18.0226C23.1701 16.5148 24.1589 14.7592 25.8167 14.5766C25.916 14.5668 26.0168 14.5645 26.0834 14.56Z", fill: "#130F40" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M25.0003 3.57153C13.1846 3.57153 3.57178 13.1844 3.57178 25.0001C3.57178 36.8167 13.1846 46.4287 25.0003 46.4287C36.8169 46.4287 46.4289 36.8167 46.4289 25.0001C46.4289 13.1844 36.8169 3.57153 25.0003 3.57153ZM12.1159 12.1156C15.5576 8.67323 20.1322 6.77885 25.0003 6.77885C29.8685 6.77885 34.4422 8.67392 37.8847 12.1157C41.3273 15.5574 43.2215 20.1327 43.2215 25.0001C43.2215 29.8674 41.3266 34.442 37.8846 37.8844C34.4431 41.327 29.8678 43.2212 25.0003 43.2212C20.133 43.2212 15.5584 41.3263 12.1159 37.8844C8.67348 34.4428 6.7791 29.8683 6.7791 25.0001C6.7791 20.132 8.67421 15.5573 12.1159 12.1156Z", fill: "#130F40" })] }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* InformationTooltip.module.css */
|
|
2
|
+
|
|
3
|
+
.wrapper {
|
|
4
|
+
@apply relative inline-flex items-center cursor-pointer;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tooltipContent {
|
|
8
|
+
@apply absolute rounded-[15px] text-sm w-56 px-4 py-3 shadow-md hidden z-10 transition-all duration-300 ease-in-out;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.wrapper:hover .tooltipContent {
|
|
12
|
+
@apply block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.arrow {
|
|
16
|
+
@apply absolute size-full hidden z-10;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.wrapper:hover .arrow {
|
|
20
|
+
@apply block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Alignment positions for tooltipContent */
|
|
24
|
+
.rightAlign {
|
|
25
|
+
left: calc(100% + 24%);
|
|
26
|
+
@apply top-1/2 transform -translate-y-1/2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.leftAlign {
|
|
30
|
+
right: calc(100% + 24%);
|
|
31
|
+
@apply top-1/2 transform -translate-y-1/2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.topAlign {
|
|
35
|
+
bottom: calc(100% + 19%);
|
|
36
|
+
@apply left-1/2 transform -translate-x-1/2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.bottomAlign {
|
|
40
|
+
top: calc(100% + 20%);
|
|
41
|
+
@apply left-1/2 transform -translate-x-1/2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Arrow positions */
|
|
45
|
+
.arrowRight {
|
|
46
|
+
left: calc(100% - 26px);
|
|
47
|
+
@apply top-1/2 transform rotate-90 -translate-x-[100%];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowLeft {
|
|
51
|
+
right: calc(100% - 27px);
|
|
52
|
+
|
|
53
|
+
@apply top-1/2 transform rotate-90 translate-x-[100%];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.arrowTop {
|
|
57
|
+
@apply left-4 bottom-2 transform rotate-0 -translate-x-1/2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.arrowBottom {
|
|
61
|
+
@apply left-4 top-2 transform rotate-180 -translate-x-1/2;
|
|
62
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils/cn";
|
|
3
|
+
import style from "./style/LoadingComp.module.css";
|
|
4
|
+
const LoadingComp = () => {
|
|
5
|
+
return (_jsx("div", { className: cn(style.parentDiv, "parentDiv"), children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", style: { margin: "auto", display: "block" }, width: "120px", height: "120px", viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid", children: [_jsx("circle", { cx: "21.5", cy: "50", r: "10", fill: "#ae00b9", children: _jsx("animate", { attributeName: "cy", values: "42;58;42", dur: "0.5882352941176471s", calcMode: "spline", keySplines: "0.5 0 0.5 1;0.5 0 0.5 1", begin: "0s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "49.5", cy: "56.92820323027551", r: "10", fill: "#f50303", children: _jsx("animate", { attributeName: "cy", values: "42;58;42", dur: "0.5882352941176471s", calcMode: "spline", keySplines: "0.5 0 0.5 1;0.5 0 0.5 1", begin: "-0.19607843137254904s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "77.5", cy: "43.07179676972449", r: "10", fill: "#ffe600", children: _jsx("animate", { attributeName: "cy", values: "42;58;42", dur: "0.5882352941176471s", calcMode: "spline", keySplines: "0.5 0 0.5 1;0.5 0 0.5 1", begin: "-0.3921568627450981s", repeatCount: "indefinite" }) })] }) }));
|
|
6
|
+
};
|
|
7
|
+
export default LoadingComp;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import style from "./style/PageLoading.module.css";
|
|
3
|
+
const PageLoading = () => {
|
|
4
|
+
return (_jsx("div", { className: style.container, children: _jsx("div", { className: style.content, children: _jsx("svg", { style: { margin: "auto", background: "#fff", display: "block" }, width: "200px", height: "200px", viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid", children: _jsxs("g", { children: [_jsx("animateTransform", { attributeName: "transform", type: "rotate", values: "0 50 50;120 50 50", keyTimes: "0;1", dur: "1s", repeatCount: "indefinite" }), _jsx("circle", { cx: "50", cy: "50", r: "29", stroke: "#ffe600", fill: "none", strokeDasharray: "30.368728984701335 182.212373908208", strokeLinecap: "round", strokeWidth: "5", transform: "rotate(0 50 50)", children: _jsx("animate", { attributeName: "stroke", values: "#ffe600;#f50303", keyTimes: "0;1", dur: "1s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "50", cy: "50", r: "29", stroke: "#f50303", fill: "none", strokeDasharray: "30.368728984701335 182.212373908208", strokeLinecap: "round", strokeWidth: "5", transform: "rotate(120 50 50)", children: _jsx("animate", { attributeName: "stroke", values: "#f50303;#ae00b9", keyTimes: "0;1", dur: "1s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "50", cy: "50", r: "29", stroke: "#ae00b9", fill: "none", strokeDasharray: "30.368728984701335 182.212373908208", strokeLinecap: "round", strokeWidth: "5", transform: "rotate(240 50 50)", children: _jsx("animate", { attributeName: "stroke", values: "#ae00b9;#ffe600", keyTimes: "0;1", dur: "1s", repeatCount: "indefinite" }) })] }) }) }) }));
|
|
5
|
+
};
|
|
6
|
+
export default PageLoading;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
type TPagination = {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
contentPerPage: number;
|
|
5
|
+
totalContent: number;
|
|
6
|
+
numberOfPages: number;
|
|
7
|
+
showingFrom: number;
|
|
8
|
+
showingTo: number;
|
|
9
|
+
pages: number[];
|
|
10
|
+
};
|
|
11
|
+
declare const Pagination: FC<{
|
|
12
|
+
data: TPagination;
|
|
13
|
+
LinkComp: any;
|
|
14
|
+
pathNameFn: any;
|
|
15
|
+
searchParamsFn: any;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export default Pagination;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import style from "./style/Pagination.module.css";
|
|
4
|
+
import { cn } from "../../lib/utils/cn";
|
|
5
|
+
const Tab = ({ path, title, isDisabled, LinkComp }) => {
|
|
6
|
+
return (_jsx(LinkComp, { href: path, className: cn(style.tab, "tab", isDisabled ? style.tabDisabled : "tabDisabled"), children: title }));
|
|
7
|
+
};
|
|
8
|
+
const Pages = ({ pages, total, disabled, pathNameFn, searchParamsFn, LinkComp }) => {
|
|
9
|
+
// const [show, setShow] = useState<boolean>(false);
|
|
10
|
+
const pathname = pathNameFn();
|
|
11
|
+
const searchParams = searchParamsFn();
|
|
12
|
+
const currentPage = Number(searchParams.get("CurrentPage")) || 1;
|
|
13
|
+
const queries = new URLSearchParams(searchParams.toString());
|
|
14
|
+
const nextPage = (pages === null || pages === void 0 ? void 0 : pages.length)
|
|
15
|
+
? Math.min(currentPage + 1, pages[pages.length - 1])
|
|
16
|
+
: currentPage;
|
|
17
|
+
// Make URL with existing queries if any
|
|
18
|
+
const mkUrl = (number) => {
|
|
19
|
+
queries.set("CurrentPage", number.toString());
|
|
20
|
+
return `${pathname}?${queries.toString()}`;
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs("div", { className: cn(style.pagesComp, " pagesComp"), children: [_jsx(Tab, { title: "<", path: mkUrl(currentPage - 1), isDisabled: currentPage === 1 || !currentPage || disabled, LinkComp: LinkComp }), pages === null || pages === void 0 ? void 0 : pages.map((number) => {
|
|
23
|
+
if (number === -100 || number === -101) {
|
|
24
|
+
return (_jsx("div", { className: cn(style.dots, "dots"), children: "...." }, number));
|
|
25
|
+
}
|
|
26
|
+
return (_jsx(LinkComp, { href: mkUrl(number), className: cn(style.linkComp, "linkComp", disabled ? style.linkCompDisabled : "linkCompDisabled", !disabled && (currentPage || 1) === number
|
|
27
|
+
? style.linkActive
|
|
28
|
+
: "linkActive"), children: number }, number));
|
|
29
|
+
}), _jsx(Tab, { title: ">", path: mkUrl(nextPage), isDisabled: currentPage === total || disabled, LinkComp: LinkComp })] }));
|
|
30
|
+
};
|
|
31
|
+
// todo: Create a Pagination data validation
|
|
32
|
+
const Pagination = ({ data, disabled = false, LinkComp, pathNameFn, searchParamsFn }) => {
|
|
33
|
+
// Hide pagination if no data
|
|
34
|
+
if (data == null) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// Hide pagination if only one page
|
|
38
|
+
return (_jsxs("div", { className: cn(style.paginationContainer, "paginationContainer"), children: [_jsxs("div", { className: cn(style.showingText, "showingText"), children: ["Showing ", data.showingFrom, " to ", data.showingTo, " of ", data.totalContent, "\u00A0 entries"] }), _jsx(Pages, { pages: data === null || data === void 0 ? void 0 : data.pages, total: data === null || data === void 0 ? void 0 : data.numberOfPages, disabled: disabled, LinkComp: LinkComp, pathNameFn: pathNameFn, searchParamsFn: searchParamsFn })] }));
|
|
39
|
+
};
|
|
40
|
+
export default Pagination;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.tab {
|
|
2
|
+
@apply px-2.5 min-h-8 text-sm flex justify-center items-center py-1 bg-secondary-100 hover:bg-secondary text-secondary hover:text-white transition-colors rounded-5;
|
|
3
|
+
}
|
|
4
|
+
.tabDisabled {
|
|
5
|
+
@apply grayscale pointer-events-none;
|
|
6
|
+
}
|
|
7
|
+
.linkComp {
|
|
8
|
+
@apply w-10 min-h-8 flex justify-center items-center py-1 bg-secondary-100 hover:bg-secondary text-secondary hover:text-white transition-colors rounded-5;
|
|
9
|
+
}
|
|
10
|
+
.linkCompDisabled {
|
|
11
|
+
@apply !bg-primary-100 !text-primary-300 pointer-events-none;
|
|
12
|
+
}
|
|
13
|
+
.linkActive {
|
|
14
|
+
@apply !bg-secondary text-white;
|
|
15
|
+
}
|
|
16
|
+
.dots {
|
|
17
|
+
@apply text-secondary;
|
|
18
|
+
}
|
|
19
|
+
.pagesComp {
|
|
20
|
+
@apply flex justify-center items-end gap-3 py-3 relative;
|
|
21
|
+
}
|
|
22
|
+
.paginationContainer {
|
|
23
|
+
@apply w-full flex justify-between items-center;
|
|
24
|
+
}
|
|
25
|
+
.showingText {
|
|
26
|
+
@apply text-primary;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TProject } from "./projectTypes";
|
|
3
|
+
declare const ProjectListBody: FC<{
|
|
4
|
+
projectData: TProject[];
|
|
5
|
+
activeProject: TProject;
|
|
6
|
+
selectProject: (project: TProject) => void;
|
|
7
|
+
ImageComponent: any;
|
|
8
|
+
}>;
|
|
9
|
+
export default ProjectListBody;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { selectorIcons } from "./selector-icons/selectorIcons";
|
|
3
|
+
import ProjectServices from "./ProjectServices";
|
|
4
|
+
const ProjectListItem = ({ data, selectProject, activeProject, ImageComponent }) => {
|
|
5
|
+
return (_jsx("li", { className: `w-full hover:bg-primary-50 p-2.5 rounded-10 ${activeProject.id === data.id ? "!bg-primary-50" : ""}`, children: _jsxs("button", { type: "button", className: "size-full flex gap-2.5 mb-2.5", onClick: () => selectProject(data), children: [_jsx("div", { className: "w-8 rounded-full ", children: _jsx(ImageComponent, { src: selectorIcons.iconDefaultApp, alt: "default-app", width: 0, height: 0, sizes: "100vw", className: "w-full h-auto rounded-full" }) }), _jsxs("div", { className: "flex-1 overflow-hidden text-left", children: [_jsx("h3", { className: "text-primary text-base font-medium whitespace-nowrap overflow-hidden text-ellipsis", children: data.title }), _jsxs("p", { className: "text-primary-200 text-sm font-normal", children: ["#", data.id] })] })] }) }));
|
|
6
|
+
};
|
|
7
|
+
const ProjectListBody = ({ projectData, activeProject, selectProject, ImageComponent }) => {
|
|
8
|
+
return (_jsxs("div", { className: "size-full flex-grow flex items-stretch gap.10 px-2.5 py-1.5 h-[calc(100%_-_96px)] md:h-[calc(100%_-_50px)] divide-x-2 divide-primary-200", children: [_jsx("div", { className: "w-[185px] pr-2.5 h-full", children: _jsx("ul", { className: "overflow-auto h-full flex flex-col gap-1", children: projectData === null || projectData === void 0 ? void 0 : projectData.map((item) => (_jsx(ProjectListItem, { data: item, selectProject: selectProject, activeProject: activeProject, ImageComponent: ImageComponent }, item.id))) }) }), _jsx("div", { className: "flex-1 px-2.5", children: _jsx(ProjectServices, {}) })] }));
|
|
9
|
+
};
|
|
10
|
+
export default ProjectListBody;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, FC, SetStateAction } from "react";
|
|
2
|
+
import { TProject } from "./projectTypes";
|
|
3
|
+
declare const ProjectListPopup: FC<{
|
|
4
|
+
setShow: Dispatch<SetStateAction<boolean>>;
|
|
5
|
+
show: boolean;
|
|
6
|
+
top: number;
|
|
7
|
+
projectData: TProject[];
|
|
8
|
+
selectProject: (project: TProject) => void;
|
|
9
|
+
activeProject: TProject;
|
|
10
|
+
ImageComponent: any;
|
|
11
|
+
}>;
|
|
12
|
+
export default ProjectListPopup;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable no-unused-vars */
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import ProjectListBody from "./ProjectListBody";
|
|
5
|
+
const CloseButton = ({ setShow, }) => {
|
|
6
|
+
return (_jsx("button", { type: "button", onClick: () => setShow(false), className: "absolute right-2.5 top-2.5 rounded-full border border-error bg-red-50 p-[3px] text-error opacity-90 block md:hidden", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-x", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }));
|
|
7
|
+
};
|
|
8
|
+
const ListHeader = () => {
|
|
9
|
+
return (_jsxs("div", { className: "flex items-end md:items-center justify-between gap-10 h-24 md:h-[50px] px-5 pb-4 md:pb-2.5 md:pt-2.5 border-b border-primary-200 rounded-tr-20 rounded-tl-20", children: [_jsx("h3", { className: "text-primary text-lg font-medium whitespace-nowrap", children: "List of Projects" }), _jsx("input", { type: "text", name: "search", placeholder: "Search Project", className: "px-2.5 w-full h-7 rounded-5 bg-primary-50 focus:outline-none" })] }));
|
|
10
|
+
};
|
|
11
|
+
const ProjectListPopup = ({ setShow, show, top, projectData, activeProject, selectProject, ImageComponent, }) => {
|
|
12
|
+
const [windowWidth, setWindowWidth] = useState(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (typeof window === "undefined")
|
|
15
|
+
return;
|
|
16
|
+
const updateSize = () => {
|
|
17
|
+
setWindowWidth(window.innerWidth);
|
|
18
|
+
};
|
|
19
|
+
window.addEventListener("resize", updateSize);
|
|
20
|
+
return () => {
|
|
21
|
+
window.removeEventListener("resize", updateSize);
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
if (!show)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsxs("div", { className: "fixed md:absolute left-0 z-[99999] size-full md:size-auto bg-white border md:rounded-10 md:max-h-[400px] min-h-[300px] md:flex flex-col overflow-auto", style: {
|
|
27
|
+
// Ensure correct top position based on window width
|
|
28
|
+
top: windowWidth > 768 ? top : 0,
|
|
29
|
+
}, children: [_jsx(CloseButton, { setShow: setShow }), _jsx(ListHeader, {}), _jsx(ProjectListBody, { projectData: projectData, selectProject: selectProject, activeProject: activeProject, ImageComponent: ImageComponent })] }));
|
|
30
|
+
};
|
|
31
|
+
export default ProjectListPopup;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TProject } from "./projectTypes";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
type TProps = {
|
|
4
|
+
projectData: TProject[];
|
|
5
|
+
activeProject: TProject;
|
|
6
|
+
selectProject: (project: TProject) => void;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
ImageComponent: any;
|
|
9
|
+
};
|
|
10
|
+
declare const ProjectSelector: FC<TProps>;
|
|
11
|
+
export default ProjectSelector;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import SelectorMainComp from "./SelectorMainComp";
|
|
6
|
+
import ProjectListPopup from "./ProjectListPopup";
|
|
7
|
+
import ProjectSelectorSkeleton from "./ProjectSelectorSkeleton";
|
|
8
|
+
const ProjectSelector = ({ projectData, activeProject, selectProject, loading, ImageComponent, }) => {
|
|
9
|
+
const [show, setShow] = useState(false);
|
|
10
|
+
const [currentHeight, setCurrentHeight] = useState(0);
|
|
11
|
+
const ref = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (ref.current) {
|
|
14
|
+
setCurrentHeight(ref.current.getBoundingClientRect().height);
|
|
15
|
+
}
|
|
16
|
+
}, [show]); // Update height when popup visibility changes
|
|
17
|
+
// Calculate the top position of the popup
|
|
18
|
+
const top = currentHeight + 10;
|
|
19
|
+
const handleClickOutside = (event) => {
|
|
20
|
+
// Check if the clicked target is outside the referenced element
|
|
21
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
22
|
+
setShow(false);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
// Bind the event listener
|
|
27
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
28
|
+
return () => {
|
|
29
|
+
// Unbind the event listener on cleanup
|
|
30
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
if (loading) {
|
|
34
|
+
return _jsx(ProjectSelectorSkeleton, {});
|
|
35
|
+
}
|
|
36
|
+
return (_jsxs("div", { ref: ref, className: "relative flex justify-center ", children: [_jsx(SelectorMainComp, { setShow: setShow, activeProject: activeProject, ImageComponent: ImageComponent }), _jsx(ProjectListPopup, { setShow: setShow, show: show, top: top, projectData: projectData, activeProject: activeProject, selectProject: selectProject, ImageComponent: ImageComponent })] }));
|
|
37
|
+
};
|
|
38
|
+
export default ProjectSelector;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "../../lib/Skeleton";
|
|
3
|
+
const ProjectSelectorSkeleton = () => {
|
|
4
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Skeleton, { className: "w-9 h-9" }), _jsx(Skeleton, { className: "w-full h-9" })] }));
|
|
5
|
+
};
|
|
6
|
+
export default ProjectSelectorSkeleton;
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// /* eslint-disable no-unused-vars */
|
|
3
|
+
// import { FC } from "react";
|
|
4
|
+
// import { projectServices } from "./projectConstants";
|
|
5
|
+
// import { TProjectService } from "./projectTypes";
|
|
6
|
+
// const ProjectServiceTabs: FC<{
|
|
7
|
+
// selectService: (id: number) => void;
|
|
8
|
+
// selectedService: number;
|
|
9
|
+
// }> = ({ selectService, selectedService }) => {
|
|
10
|
+
// return (
|
|
11
|
+
// <div className="flex justify-between items-center border-b border-primary-200 mb-2.5">
|
|
12
|
+
// {projectServices.map((service: TProjectService) => (
|
|
13
|
+
// <button
|
|
14
|
+
// key={service.id}
|
|
15
|
+
// className={`text-base p-2.5 ${
|
|
16
|
+
// selectedService === service.id
|
|
17
|
+
// ? "text-primary font-medium"
|
|
18
|
+
// : "text-primary-500 font-normal"
|
|
19
|
+
// }`}
|
|
20
|
+
// onClick={() => selectService(service.id)}
|
|
21
|
+
// >
|
|
22
|
+
// {service.title}
|
|
23
|
+
// </button>
|
|
24
|
+
// ))}
|
|
25
|
+
// </div>
|
|
26
|
+
// );
|
|
27
|
+
// };
|
|
28
|
+
// export default ProjectServiceTabs;
|