@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.
Files changed (184) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -0
  3. package/dist/components/Profile/LoginBtn.d.ts +8 -0
  4. package/dist/components/Profile/LoginBtn.js +13 -0
  5. package/dist/components/Profile/ProfileManage.d.ts +12 -0
  6. package/dist/components/Profile/ProfileManage.js +45 -0
  7. package/dist/components/Profile/ProfileMenuList.d.ts +5 -0
  8. package/dist/components/Profile/ProfileMenuList.js +32 -0
  9. package/dist/components/Profile/ProfileMenuPopup.d.ts +12 -0
  10. package/dist/components/Profile/ProfileMenuPopup.js +26 -0
  11. package/dist/components/Profile/ProfileUserInformation.d.ts +8 -0
  12. package/dist/components/Profile/ProfileUserInformation.js +9 -0
  13. package/dist/components/Profile/ProfileView.d.ts +14 -0
  14. package/dist/components/Profile/ProfileView.js +9 -0
  15. package/dist/components/Profile/authTypes.d.ts +21 -0
  16. package/dist/components/Profile/authTypes.js +1 -0
  17. package/dist/components/Profile/authTypes.ts +22 -0
  18. package/dist/components/Profile/icons.d.ts +9 -0
  19. package/dist/components/Profile/icons.js +33 -0
  20. package/dist/components/Profile/style/LoginBtn.module.css +6 -0
  21. package/dist/components/Profile/style/ProfileManage.module.css +6 -0
  22. package/dist/components/Profile/style/ProfileMenuList.module.css +50 -0
  23. package/dist/components/Profile/style/ProfileMenuPopup.module.css +30 -0
  24. package/dist/components/Profile/style/ProfileUserInformation.module.css +26 -0
  25. package/dist/components/Profile/style/ProfileView.module.css +12 -0
  26. package/dist/components/button-wrapper/ButtonWrapper.d.ts +14 -0
  27. package/dist/components/button-wrapper/ButtonWrapper.js +11 -0
  28. package/dist/components/button-wrapper/icons/icon.d.ts +1 -0
  29. package/dist/components/button-wrapper/icons/icon.js +4 -0
  30. package/dist/components/button-wrapper/style/style.module.css +18 -0
  31. package/dist/components/cookie-accept-popup/CookiesAcceptPopup.d.ts +2 -0
  32. package/dist/components/cookie-accept-popup/CookiesAcceptPopup.js +28 -0
  33. package/dist/components/cookie-accept-popup/style/CookieAcceptPopup.module.css +12 -0
  34. package/dist/components/copy-wrapper/CopyWrapper.d.ts +6 -0
  35. package/dist/components/copy-wrapper/CopyWrapper.js +9 -0
  36. package/dist/components/copy-wrapper/icon/icons.d.ts +2 -0
  37. package/dist/components/copy-wrapper/icon/icons.js +7 -0
  38. package/dist/components/currency-selector/CurrencySelector.d.ts +14 -0
  39. package/dist/components/currency-selector/CurrencySelector.js +47 -0
  40. package/dist/components/currency-selector/style/CurrencySelector.module.css +28 -0
  41. package/dist/components/custom-sidebar/CustomSidebar.d.ts +15 -0
  42. package/dist/components/custom-sidebar/CustomSidebar.js +29 -0
  43. package/dist/components/custom-sidebar/icons.d.ts +3 -0
  44. package/dist/components/custom-sidebar/icons.js +7 -0
  45. package/dist/components/custom-sidebar/style/CustomSidebar.module.css +21 -0
  46. package/dist/components/filter-wrapper/FilterBarWrapper.d.ts +12 -0
  47. package/dist/components/filter-wrapper/FilterBarWrapper.js +85 -0
  48. package/dist/components/filter-wrapper/SearchInput.d.ts +10 -0
  49. package/dist/components/filter-wrapper/SearchInput.js +8 -0
  50. package/dist/components/filter-wrapper/icons/Icons.d.ts +2 -0
  51. package/dist/components/filter-wrapper/icons/Icons.js +7 -0
  52. package/dist/components/filter-wrapper/style/FilterBarWrapper.module.css +41 -0
  53. package/dist/components/header/FixedHeaderControl.d.ts +7 -0
  54. package/dist/components/header/FixedHeaderControl.js +23 -0
  55. package/dist/components/header/HeaderLoginColumnComp.d.ts +25 -0
  56. package/dist/components/header/HeaderLoginColumnComp.js +36 -0
  57. package/dist/components/header/HeaderLogoComp.d.ts +6 -0
  58. package/dist/components/header/HeaderLogoComp.js +6 -0
  59. package/dist/components/header/HeaderSection.d.ts +21 -0
  60. package/dist/components/header/HeaderSection.js +27 -0
  61. package/dist/components/header/HeaderServiceBtnComp.d.ts +10 -0
  62. package/dist/components/header/HeaderServiceBtnComp.js +17 -0
  63. package/dist/components/header/HeaderToggleMenuComp.d.ts +9 -0
  64. package/dist/components/header/HeaderToggleMenuComp.js +16 -0
  65. package/dist/components/header/NavbarComp.d.ts +11 -0
  66. package/dist/components/header/NavbarComp.js +46 -0
  67. package/dist/components/header/header.css +61 -0
  68. package/dist/components/header/headerType.d.ts +14 -0
  69. package/dist/components/header/headerType.js +1 -0
  70. package/dist/components/header/headerType.ts +15 -0
  71. package/dist/components/header/icons/icon-about-us-submenu.svg +6 -0
  72. package/dist/components/header/icons/icon-about-us.svg +5 -0
  73. package/dist/components/header/icons/icon-all-service.svg +11 -0
  74. package/dist/components/header/icons/icon-arrow-v2.svg +3 -0
  75. package/dist/components/header/icons/icon-bell-fill.svg +3 -0
  76. package/dist/components/header/icons/icon-bik-logo.svg +13 -0
  77. package/dist/components/header/icons/icon-contacts.svg +6 -0
  78. package/dist/components/header/icons/icon-domain.svg +4 -0
  79. package/dist/components/header/icons/icon-hosting.svg +5 -0
  80. package/dist/components/header/icons/icon-our-clients.svg +4 -0
  81. package/dist/components/header/icons/icons.d.ts +14 -0
  82. package/dist/components/header/icons/icons.js +27 -0
  83. package/dist/components/header/sidebar/SidebarConstants.d.ts +0 -0
  84. package/dist/components/header/sidebar/SidebarConstants.js +55 -0
  85. package/dist/components/header/sidebar/SidebarConstants.ts +55 -0
  86. package/dist/components/header/sidebar/SidebarIcons.d.ts +5 -0
  87. package/dist/components/header/sidebar/SidebarIcons.js +9 -0
  88. package/dist/components/header/sidebar/SidebarMenu.d.ts +12 -0
  89. package/dist/components/header/sidebar/SidebarMenu.js +28 -0
  90. package/dist/components/header/sidebar/SidebarMenuRow.d.ts +10 -0
  91. package/dist/components/header/sidebar/SidebarMenuRow.js +32 -0
  92. package/dist/components/header/sidebar/SidebarSubMenu.d.ts +9 -0
  93. package/dist/components/header/sidebar/SidebarSubMenu.js +14 -0
  94. package/dist/components/header/sidebar/SidebarTopRow.d.ts +0 -0
  95. package/dist/components/header/sidebar/SidebarTopRow.js +100 -0
  96. package/dist/components/header/sidebar/sidebarStyle.css +32 -0
  97. package/dist/components/information-tooltip/InformationTooltip.d.ts +11 -0
  98. package/dist/components/information-tooltip/InformationTooltip.js +27 -0
  99. package/dist/components/information-tooltip/icons.d.ts +6 -0
  100. package/dist/components/information-tooltip/icons.js +10 -0
  101. package/dist/components/information-tooltip/style/InfoTooltip.module.css +62 -0
  102. package/dist/components/loading-comp/LoadingComp.d.ts +2 -0
  103. package/dist/components/loading-comp/LoadingComp.js +7 -0
  104. package/dist/components/loading-comp/style/LoadingComp.module.css +3 -0
  105. package/dist/components/pageLoading/PageLoading.d.ts +2 -0
  106. package/dist/components/pageLoading/PageLoading.js +6 -0
  107. package/dist/components/pageLoading/style/PageLoading.module.css +7 -0
  108. package/dist/components/pagination2/Pagination.d.ts +18 -0
  109. package/dist/components/pagination2/Pagination.js +40 -0
  110. package/dist/components/pagination2/style/Pagination.module.css +27 -0
  111. package/dist/components/project-selector/ProjectListBody.d.ts +9 -0
  112. package/dist/components/project-selector/ProjectListBody.js +10 -0
  113. package/dist/components/project-selector/ProjectListPopup.d.ts +12 -0
  114. package/dist/components/project-selector/ProjectListPopup.js +31 -0
  115. package/dist/components/project-selector/ProjectSelector.d.ts +11 -0
  116. package/dist/components/project-selector/ProjectSelector.js +38 -0
  117. package/dist/components/project-selector/ProjectSelectorSkeleton.d.ts +3 -0
  118. package/dist/components/project-selector/ProjectSelectorSkeleton.js +6 -0
  119. package/dist/components/project-selector/ProjectServiceTabs.d.ts +0 -0
  120. package/dist/components/project-selector/ProjectServiceTabs.js +28 -0
  121. package/dist/components/project-selector/ProjectServices.d.ts +3 -0
  122. package/dist/components/project-selector/ProjectServices.js +12 -0
  123. package/dist/components/project-selector/SelectorMainComp.d.ts +8 -0
  124. package/dist/components/project-selector/SelectorMainComp.js +6 -0
  125. package/dist/components/project-selector/projectConstants.d.ts +2 -0
  126. package/dist/components/project-selector/projectConstants.js +20 -0
  127. package/dist/components/project-selector/projectConstants.ts +23 -0
  128. package/dist/components/project-selector/projectTypes.d.ts +22 -0
  129. package/dist/components/project-selector/projectTypes.js +1 -0
  130. package/dist/components/project-selector/projectTypes.ts +22 -0
  131. package/dist/components/project-selector/selector-icons/icon-arrow-down.svg +3 -0
  132. package/dist/components/project-selector/selector-icons/icon-default-app.svg +9 -0
  133. package/dist/components/project-selector/selector-icons/selectorIcons.d.ts +4 -0
  134. package/dist/components/project-selector/selector-icons/selectorIcons.js +6 -0
  135. package/dist/components/services-popup/ServiceAppType.d.ts +9 -0
  136. package/dist/components/services-popup/ServiceAppType.js +1 -0
  137. package/dist/components/services-popup/ServiceAppType.ts +10 -0
  138. package/dist/components/services-popup/ServicesPopup.d.ts +19 -0
  139. package/dist/components/services-popup/ServicesPopup.js +35 -0
  140. package/dist/components/services-popup/components/AppAccount.d.ts +7 -0
  141. package/dist/components/services-popup/components/AppAccount.js +8 -0
  142. package/dist/components/services-popup/components/ServiceApp.d.ts +8 -0
  143. package/dist/components/services-popup/components/ServiceApp.js +6 -0
  144. package/dist/components/services-popup/icons/Icons.d.ts +5 -0
  145. package/dist/components/services-popup/icons/Icons.js +8 -0
  146. package/dist/components/services-popup/icons/icon-account.svg +7 -0
  147. package/dist/components/services-popup/icons/icon-cross.svg +3 -0
  148. package/dist/components/services-popup/icons/icon-default-app.svg +9 -0
  149. package/dist/components/user-info/TooltipUserInfo.d.ts +8 -0
  150. package/dist/components/user-info/TooltipUserInfo.js +29 -0
  151. package/dist/components/user-info/UserInfoComp.d.ts +8 -0
  152. package/dist/components/user-info/UserInfoComp.js +7 -0
  153. package/dist/components/user-info/icons/icons.d.ts +1 -0
  154. package/dist/components/user-info/icons/icons.js +4 -0
  155. package/dist/components/user-info/style/ToolTipUserInfo.module.css +28 -0
  156. package/dist/declaration.d.ts +9 -0
  157. package/dist/index.d.ts +15 -0
  158. package/dist/index.js +15 -0
  159. package/dist/index.ts +15 -0
  160. package/dist/lib/Skeleton.d.ts +4 -0
  161. package/dist/lib/Skeleton.js +18 -0
  162. package/dist/lib/types/GlobalType.d.ts +9 -0
  163. package/dist/lib/types/GlobalType.js +1 -0
  164. package/dist/lib/types/GlobalType.ts +17 -0
  165. package/dist/lib/utils/Cookie.d.ts +11 -0
  166. package/dist/lib/utils/Cookie.js +46 -0
  167. package/dist/lib/utils/Cookie.ts +58 -0
  168. package/dist/lib/utils/Copy.d.ts +5 -0
  169. package/dist/lib/utils/Copy.js +32 -0
  170. package/dist/lib/utils/Copy.ts +37 -0
  171. package/dist/lib/utils/Env.d.ts +35 -0
  172. package/dist/lib/utils/Env.js +190 -0
  173. package/dist/lib/utils/Env.ts +236 -0
  174. package/dist/lib/utils/capitalizeFirstLetter.d.ts +2 -0
  175. package/dist/lib/utils/capitalizeFirstLetter.js +7 -0
  176. package/dist/lib/utils/capitalizeFirstLetter.ts +7 -0
  177. package/dist/lib/utils/cn.d.ts +2 -0
  178. package/dist/lib/utils/cn.js +3 -0
  179. package/dist/lib/utils/cn.ts +4 -0
  180. package/dist/lib/utils/option.d.ts +10 -0
  181. package/dist/lib/utils/option.js +6 -0
  182. package/dist/lib/utils/option.ts +7 -0
  183. package/dist/package.json +1 -0
  184. package/package.json +60 -0
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils/cn";
3
+ import { iconLoading } from "./icons/icon";
4
+ import style from "./style/style.module.css";
5
+ export const ButtonLoading = () => {
6
+ return (_jsx("div", { className: cn(style.btnLoadingWrapper, "btnLoadingWrapper"), children: _jsx("span", { className: cn(style.btnContent, "btnContent"), children: iconLoading() }) }));
7
+ };
8
+ const ButtonWrapper = ({ className, onClick, ImageComponent, blockIcon, hoverIcon, loading, disabled, }) => {
9
+ return (_jsxs("button", { className: cn(style.btnClass, "group", className), onClick: onClick, disabled: disabled, children: [_jsx(ImageComponent, { src: blockIcon, width: 100, height: 100, alt: "sync", sizes: "100vw", className: cn(style.blockIcon, "group-hover:hidden", "blockIcon") }), _jsx(ImageComponent, { src: hoverIcon, width: 100, height: 100, alt: "sync", sizes: "100vw", className: cn(style.hoverIcon, "group-hover:block", "hoverIcon") }), loading ? (_jsx("div", { className: cn(style.btnLoading, "btnLoading"), children: _jsx(ButtonLoading, {}) })) : null] }));
10
+ };
11
+ export default ButtonWrapper;
@@ -0,0 +1 @@
1
+ export declare const iconLoading: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const iconLoading = () => {
3
+ return (_jsx("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-loader-circle", children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", children: _jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "1s", repeatCount: "indefinite" }) }) }));
4
+ };
@@ -0,0 +1,18 @@
1
+ .btnClass {
2
+ @apply relative px-3 py-2 flex justify-center items-center !bg-secondary-50 hover:!bg-secondary;
3
+ }
4
+ .blockIcon {
5
+ @apply size-7 block;
6
+ }
7
+ .hoverIcon {
8
+ @apply size-7 hidden;
9
+ }
10
+ .btnLoading {
11
+ @apply absolute top-0 left-0 size-full text-primary;
12
+ }
13
+ .btnLoadingWrapper {
14
+ @apply size-full bg-primary-50 opacity-50 absolute top-0 left-0;
15
+ }
16
+ .btnContent {
17
+ @apply absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2;
18
+ }
@@ -0,0 +1,2 @@
1
+ declare const CookiesAcceptPopup: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default CookiesAcceptPopup;
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { getBaseDomain, getBikiranUrl } from "../../lib/utils/Env";
5
+ import style from "./style/CookieAcceptPopup.module.css";
6
+ import Cookie from "../../lib/utils/Cookie";
7
+ import { cn } from "../../lib/utils/cn";
8
+ const CookiesAcceptPopup = () => {
9
+ // State to control the popup visibility
10
+ const [mode, setMode] = useState(false);
11
+ // State to check if the user has already accepted the cookie policy
12
+ const [isAccept, setIsAccept] = useState(new Cookie("accept-tc", getBaseDomain()).verifyCookie("yes"));
13
+ // Handle mode change when the user accepts cookies
14
+ useEffect(() => {
15
+ if (mode) {
16
+ // Set Data to cookies to parent domain
17
+ const cookie = new Cookie("accept-tc", getBaseDomain());
18
+ cookie.setCookie("yes", 365);
19
+ setIsAccept(true);
20
+ }
21
+ }, [mode]);
22
+ // Return null if cookies have already been accepted
23
+ if (isAccept) {
24
+ return null;
25
+ }
26
+ return (_jsxs("div", { className: cn(style.container, "container"), children: [_jsxs("p", { className: cn(style.text, "text"), children: ["This site uses cookies. By continuing to use this website, you agree to their use. For details, please check our", " ", _jsx("a", { href: getBikiranUrl() + "/legal/privacy-policy", target: "_blank", className: cn(style.a, "a"), children: "Privacy Policy" }), "."] }), _jsx("button", { type: "button", className: cn(style.btn, "btn"), onClick: () => setMode(true), children: "I Accept" })] }));
27
+ };
28
+ export default CookiesAcceptPopup;
@@ -0,0 +1,12 @@
1
+ .container {
2
+ @apply fixed bottom-7 z-[9999999] sm:bottom-16 left-5 w-[320px] sm:w-[405px] bg-white shadow-[0px_3px_50px_0px_rgba(19,15,64,0.08)] rounded-15 p-5 sm:px-5 sm:py-[25px];
3
+ }
4
+ .text {
5
+ @apply text-primary-700 text-sm sm:text-base font-normal leading-[25px] mb-4 sm:mb-[18px];
6
+ }
7
+ .a {
8
+ @apply text-secondary;
9
+ }
10
+ .btn {
11
+ @apply h-10 bg-secondary text-white text-sm sm:text-base font-medium px-4 sm:px-5 rounded-[8px];
12
+ }
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ declare const CopyWrapper: FC<{
3
+ content: any;
4
+ className?: string;
5
+ }>;
6
+ export default CopyWrapper;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Copy from "../../lib/utils/Copy";
3
+ import { cn } from "../../lib/utils/cn";
4
+ import { iconCopy, iconTick } from "./icon/icons";
5
+ const CopyWrapper = ({ content, className, }) => {
6
+ const { copy, isCopied } = Copy();
7
+ return (_jsxs("button", { className: cn("flex items-center gap-1 group", className), onClick: () => copy(content), children: [_jsx("div", { className: "text-sm", children: content }), isCopied ? (_jsx("div", { children: iconTick() })) : (_jsx("div", { className: "group-hover:block hidden", children: iconCopy() }))] }));
8
+ };
9
+ export default CopyWrapper;
@@ -0,0 +1,2 @@
1
+ export declare const iconTick: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const iconCopy: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const iconTick = () => {
3
+ return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.72392 17.9089L8.52392 24.7199C8.88692 25.1549 9.36692 25.4809 9.90492 25.6569C10.6999 25.9069 11.7999 25.8899 12.7439 24.5429L25.6989 4.34391C25.7949 4.19491 25.8689 4.03191 25.9179 3.86391C26.1099 3.20391 26.0689 1.75491 24.6309 2.33391C24.2319 2.49691 23.8789 2.75891 23.6079 3.09291L11.3979 17.7869C10.9299 18.3509 10.0939 18.4279 9.52892 17.9599C9.47592 17.9169 9.42592 17.8689 9.37992 17.8159L6.65392 14.7179C6.10192 14.0739 5.31092 13.6829 4.46392 13.6299C3.54892 13.5919 2.49192 13.8609 2.10492 15.1959C1.84492 16.1489 2.07592 17.1639 2.72392 17.9089Z", fill: "#130F40" }) }));
4
+ };
5
+ export const iconCopy = () => {
6
+ return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.4772 1.42859H7.31432C6.68218 1.42859 6.16789 1.94287 6.16789 2.57502V3.6543H4.33004C3.25289 3.6543 2.37646 4.53073 2.37646 5.60787V16.6179C2.37646 17.695 3.25289 18.5714 4.33004 18.5714H13.5208C14.5986 18.5714 15.4743 17.695 15.4743 16.6179V14.6993H16.4772C17.1093 14.6993 17.6236 14.185 17.6236 13.5529V2.57502C17.6236 1.94287 17.1093 1.42859 16.4772 1.42859ZM14.15 16.6179C14.15 16.9657 13.8679 17.2479 13.5208 17.2479H4.33004C3.98289 17.2479 3.70004 16.9657 3.70004 16.6179V5.60787C3.70004 5.26073 3.98289 4.97859 4.33004 4.97859H6.16789V13.5529C6.16789 14.185 6.68218 14.6993 7.31432 14.6993H14.1493L14.15 16.6179ZM16.2993 12.745C16.2993 13.0929 16.0172 13.375 15.6693 13.375H8.12147C7.77432 13.375 7.49147 13.0929 7.49147 12.745V3.38287C7.49147 3.03573 7.77432 2.75287 8.12147 2.75287H12.3286L12.3565 2.86287C12.8315 4.77359 14.3022 6.30787 16.195 6.86502L16.2993 6.89573V12.745Z", fill: "#130F40" }) }));
7
+ };
@@ -0,0 +1,14 @@
1
+ import { ReactNode, FC } from "react";
2
+ type TCurrencyDropdownProps = {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ onClick?: (currency: string) => void;
6
+ value?: string;
7
+ useApp: () => {
8
+ currencies: any;
9
+ locale: any;
10
+ handelChangeLocale: (currency: string) => void;
11
+ };
12
+ };
13
+ declare const CurrencySelector: FC<TCurrencyDropdownProps>;
14
+ export default CurrencySelector;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import style from "./style/CurrencySelector.module.css";
5
+ import { cn } from "../../lib/utils/cn";
6
+ function IconArrow({ className }) {
7
+ return (_jsx("svg", { width: "12", height: "7", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: `transform transition-all ${className}`, children: _jsx("path", { d: "M.808 5.159a.971.971 0 1 0 1.387 1.36l2.45-2.499c.627-.638.94-.958 1.337-.973.397-.015.734.28 1.407.868l2.636 2.303a.971.971 0 0 0 1.278-1.463l-4.016-3.51C6.613.656 6.277.362 5.879.378c-.397.015-.71.334-1.336.973L.808 5.159Z", fill: "currentColor" }) }));
8
+ }
9
+ function Option({ item, isCurrent, onClick }) {
10
+ return (_jsxs("button", { type: "button", className: cn(style.option, "option", isCurrent ? style.isCurrent : "isCurrent"), onClick: onClick, children: [_jsx("span", { children: (item === null || item === void 0 ? void 0 : item.currency) || "--" }), " ", _jsx("span", { children: (item === null || item === void 0 ? void 0 : item.currency) === "USD" ? "$" : "৳" })] }));
11
+ }
12
+ const CurrencySelector = ({ children, className, onClick, value, useApp, }) => {
13
+ const [open, setOpen] = useState(true);
14
+ const ref = useRef(null);
15
+ const { currencies, locale, handelChangeLocale } = useApp();
16
+ const isCustomHandler = onClick && typeof onClick === "function";
17
+ const handleOptionClick = (ev, item) => {
18
+ setOpen(true);
19
+ if (isCustomHandler) {
20
+ onClick(item === null || item === void 0 ? void 0 : item.currency);
21
+ }
22
+ else {
23
+ handelChangeLocale(item === null || item === void 0 ? void 0 : item.currency);
24
+ }
25
+ };
26
+ const handleMenuClick = (ev) => {
27
+ ev.preventDefault();
28
+ ev.stopPropagation();
29
+ setOpen((prev) => !prev);
30
+ };
31
+ useEffect(() => {
32
+ function handleClickOutside(event) {
33
+ if (ref.current && !ref.current.contains(event.target)) {
34
+ setOpen(true);
35
+ }
36
+ }
37
+ document.addEventListener("mousedown", (ev) => handleClickOutside(ev));
38
+ return () => {
39
+ document.removeEventListener("mousedown", (ev) => handleClickOutside(ev));
40
+ };
41
+ }, [ref]);
42
+ return (_jsxs("div", { className: cn(style.container, className, "container"), ref: ref, children: [children ? (_jsx("button", { type: "button", className: "", onClick: handleMenuClick, children: children })) : (_jsxs("button", { type: "button", className: cn(style.btn, "btn"), onClick: handleMenuClick, children: [_jsx("h2", { className: cn(style.currency, "currency"), children: isCustomHandler ? value : locale === null || locale === void 0 ? void 0 : locale.currency }), _jsx(IconArrow, { className: cn(style.iconArrow, "iconArrow", open ? style.iconArrowOpen : "iconArrowOpen") })] })), _jsx("div", { className: cn(style.dropDown, "dropDown", open ? style.dropDownOpen : "dropDownOpen"), children: currencies &&
43
+ currencies.map((item) => (_jsx(Option, { item: item, isCurrent: isCustomHandler
44
+ ? (item === null || item === void 0 ? void 0 : item.currency) === value
45
+ : (locale === null || locale === void 0 ? void 0 : locale.currency) === (item === null || item === void 0 ? void 0 : item.currency), onClick: (ev) => handleOptionClick(ev, item) }, item.currency))) })] }));
46
+ };
47
+ export default CurrencySelector;
@@ -0,0 +1,28 @@
1
+ .container {
2
+ @apply size-full rounded-[25px] cursor-pointer relative;
3
+ }
4
+ .btn {
5
+ @apply w-full flex items-center justify-between;
6
+ }
7
+ .currency {
8
+ @apply text-primary text-sm font-medium;
9
+ }
10
+ .iconArrow {
11
+ @apply text-primary rotate-0;
12
+ }
13
+ .iconArrowOpen {
14
+ @apply rotate-180;
15
+ }
16
+ .dropDown {
17
+ @apply w-[80px] bg-white shadow-lg absolute -left-2.5 rounded-[7px] top-8 z-10 visible transition-all;
18
+ }
19
+ .dropDownOpen {
20
+ @apply top-0 -z-10 invisible;
21
+ }
22
+ .option {
23
+ @apply w-full flex items-center justify-between text-sm py-[7px] px-3 border-b border-secondary-100 last:border-0 first:rounded-tl-[7px] first:rounded-tr-[7px] last:rounded-bl-[7px] last:rounded-br-[7px] hover:text-secondary text-primary;
24
+ }
25
+
26
+ .isCurrent {
27
+ @apply text-secondary;
28
+ }
@@ -0,0 +1,15 @@
1
+ import { FC, ReactNode } from "react";
2
+ type TProps = {
3
+ children: ReactNode;
4
+ className?: string;
5
+ showType: string;
6
+ usePathname: () => string;
7
+ useTemplate: () => {
8
+ modalType: string;
9
+ closeModal: () => void;
10
+ openModal: (type: string, data: any) => void;
11
+ modalData: any;
12
+ };
13
+ };
14
+ declare const CustomSidebar: FC<TProps>;
15
+ export default CustomSidebar;
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
4
+ import { cn } from "../../lib/utils/cn";
5
+ import { IconClose } from "./icons";
6
+ import style from "./style/CustomSidebar.module.css";
7
+ const Content = ({ children, className }) => {
8
+ return (_jsx("div", { className: cn(style.content, "content custom-scrollbar", className), children: children }));
9
+ };
10
+ const CustomSidebar = ({ children, className, showType, usePathname, useTemplate, }) => {
11
+ const { modalType, closeModal, openModal, modalData } = useTemplate();
12
+ const pathname = usePathname();
13
+ const isOpen = modalType === showType;
14
+ const handleToggle = () => {
15
+ if (isOpen) {
16
+ openModal("", modalData);
17
+ }
18
+ else {
19
+ openModal(showType, modalData);
20
+ }
21
+ };
22
+ useEffect(() => {
23
+ if (isOpen) {
24
+ closeModal();
25
+ }
26
+ }, [pathname]);
27
+ return (_jsx("div", { className: cn(style.container, className, modalType === showType ? style.type : "type"), children: _jsxs("div", { className: "flex items-stretch h-full", children: [_jsx("div", { className: cn(style.sidebarBody, "sidebarBody", isOpen ? style.sidebarBodyOpen : "sidebarBodyOpen"), children: _jsx("button", { type: "button", onClick: handleToggle, className: cn(style.btnClose, "btnClose", !isOpen ? style.notOpen : "notOpen"), children: isOpen ? _jsx(IconClose, {}) : null }) }), _jsx(Content, { className: "content-wrapper", children: children })] }) }));
28
+ };
29
+ export default CustomSidebar;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ export declare const IconClose: FC;
3
+ export declare const IconArrow: FC;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const IconClose = () => {
3
+ return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 24 24", fill: "none", stroke: "#2b2754", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-x h-4 w-4", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }));
4
+ };
5
+ export const IconArrow = () => {
6
+ return (_jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M24.525 12.655H7.024L13.018 7.16495C13.294 6.91195 13.447 6.57595 13.448 6.21995C13.449 5.86295 13.298 5.52695 13.023 5.27295C12.447 4.73995 11.507 4.73795 10.928 5.26895L2.429 13.052C2.152 13.306 2 13.642 2 13.999C2 14.357 2.152 14.694 2.428 14.947L2.427 14.948L10.928 22.731C11.507 23.261 12.447 23.26 13.023 22.726C13.298 22.472 13.449 22.136 13.448 21.779C13.447 21.422 13.295 21.087 13.018 20.834L7.024 15.344H24.526C25.338 15.344 26 14.742 26 14C26 13.258 25.338 12.655 24.525 12.655Z", fill: "#130F40" }) }));
7
+ };
@@ -0,0 +1,21 @@
1
+ .container {
2
+ @apply max-w-[800px] w-full h-full fixed top-[50px] right-0 z-[1] transition-[transform_right] transform translate-x-full;
3
+ }
4
+ .type {
5
+ @apply translate-x-0;
6
+ }
7
+ .sidebarBody {
8
+ @apply w-0 h-full bg-primary-100 flex flex-col items-center py-3;
9
+ }
10
+ .sidebarBodyOpen {
11
+ @apply w-16;
12
+ }
13
+ .notOpen {
14
+ @apply bg-transparent border-0;
15
+ }
16
+ .btnClose {
17
+ @apply border border-primary-300 rounded-full bg-primary-300 size-7.5 flex justify-center items-center;
18
+ }
19
+ .content {
20
+ @apply flex-1 bg-white p-5 pb-20 overflow-auto;
21
+ }
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ type TProps = {
3
+ formData: Record<string, any>;
4
+ onSearch: (search: string) => void;
5
+ resetClick?: () => void;
6
+ children: React.ReactNode;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ };
11
+ declare const FilterBarWrapper: FC<TProps>;
12
+ export default FilterBarWrapper;
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import SearchInput from "./SearchInput";
4
+ import { iconReset } from "./icons/Icons";
5
+ import style from "./style/FilterBarWrapper.module.css";
6
+ import { cn } from "../../lib/utils/cn";
7
+ const getStrValue = (filter) => {
8
+ var _a, _b, _c;
9
+ // //check if value is not string type then convert it to string
10
+ if (Object.values(filter).some((val) => typeof val !== "string")) {
11
+ const newFilter = Object.assign({}, filter);
12
+ Object.keys(newFilter).forEach((key) => {
13
+ if (typeof newFilter[key] !== "string") {
14
+ newFilter[key] = JSON.stringify(newFilter[key]);
15
+ }
16
+ });
17
+ return (_a = JSON === null || JSON === void 0 ? void 0 : JSON.stringify(newFilter)) === null || _a === void 0 ? void 0 : _a.replace(/[{},"]/g, " ");
18
+ }
19
+ //if any property is empty then remove that property
20
+ if (Object.values(filter).some((val) => (val === null || val === void 0 ? void 0 : val.trim()) === "")) {
21
+ const newFilter = Object.assign({}, filter);
22
+ Object.keys(newFilter).forEach((key) => {
23
+ var _a;
24
+ if (((_a = newFilter[key]) === null || _a === void 0 ? void 0 : _a.trim()) === "") {
25
+ delete newFilter[key];
26
+ }
27
+ });
28
+ return (_b = JSON === null || JSON === void 0 ? void 0 : JSON.stringify(newFilter)) === null || _b === void 0 ? void 0 : _b.replace(/[{},"]/g, " ");
29
+ }
30
+ return (_c = JSON === null || JSON === void 0 ? void 0 : JSON.stringify(filter)) === null || _c === void 0 ? void 0 : _c.replace(/[{},"]/g, " ");
31
+ };
32
+ const FilterBarWrapper = ({ children, formData, disabled, placeholder = "Search anything...", onSearch, resetClick, className, }) => {
33
+ const [isFilterOpen, setIsFilterOpen] = useState(false);
34
+ // get queries
35
+ const urlParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");
36
+ // get properties of formData object from urlParams
37
+ const properties = Object.fromEntries(Object.keys(formData).map((key) => [key, urlParams.get(key) || ""])) || {};
38
+ const [filters, setFilters] = useState(properties);
39
+ const [isFocus, setIsFocus] = useState(false);
40
+ const ref = useRef(null);
41
+ const filterValues = Object.keys(filters).length > 0 ? filters : properties;
42
+ const searchedValue = getStrValue(filterValues) || "";
43
+ useEffect(() => {
44
+ const urlParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");
45
+ const properties = Object.fromEntries(Object.keys(formData).map((key) => [key, urlParams.get(key) || ""])) || {};
46
+ setFilters(properties);
47
+ }, [window.location.search]);
48
+ // outside click
49
+ useEffect(() => {
50
+ const handleClickOutside = (e) => {
51
+ var _a, _b;
52
+ const isSelectClick = ((_a = e.target) === null || _a === void 0 ? void 0 : _a.closest('[role="combobox"]')) ||
53
+ ((_b = e.target) === null || _b === void 0 ? void 0 : _b.closest('[role="listbox"]'));
54
+ if (ref.current &&
55
+ !ref.current.contains(e.target) &&
56
+ !isSelectClick) {
57
+ setIsFilterOpen(false);
58
+ setIsFocus(false);
59
+ }
60
+ };
61
+ document.addEventListener("mousedown", handleClickOutside);
62
+ return () => {
63
+ document.removeEventListener("mousedown", handleClickOutside);
64
+ };
65
+ }, [ref]);
66
+ const isOpen = isFilterOpen || isFocus;
67
+ const handleSearch = () => {
68
+ // Build the query string
69
+ const queryString = Object.entries(formData)
70
+ .filter(([_, value]) => value) // Filter out empty values
71
+ .map(([key, value]) => `${key}=${value}`)
72
+ .join("&");
73
+ onSearch(`?${queryString}`);
74
+ };
75
+ const onSubmit = (e) => {
76
+ e.preventDefault();
77
+ handleSearch();
78
+ setIsFilterOpen(false);
79
+ setIsFocus(false);
80
+ };
81
+ return (_jsxs("div", { className: cn(style.filterBarContainer, "filterBarContainer", className, disabled
82
+ ? style.filterBarContainerDisabled
83
+ : "filterBarContainerDisabled"), ref: ref, children: [_jsx(SearchInput, { isOpen: isOpen, onFocus: () => setIsFocus(true), toggleFilter: () => setIsFilterOpen((prev) => !prev), searchedValue: searchedValue, placeholder: placeholder }), _jsx("div", { className: cn(style.expandSection, "expandSection", isOpen ? `${style.isExpanded} isExpanded` : ""), children: _jsxs("form", { onSubmit: onSubmit, className: cn(style.form, "form"), children: [children, _jsxs("div", { className: style.buttonContainer, children: [resetClick !== undefined && (_jsx("button", { type: "button", onClick: resetClick, className: cn(style.resetBtn, "resetBtn group"), children: iconReset("text-secondary group-hover:text-white") })), _jsx("button", { className: cn(style.searchBtn, "searchBtn"), children: "Search" })] })] }) })] }));
84
+ };
85
+ export default FilterBarWrapper;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ type TProps = {
3
+ isOpen: boolean;
4
+ onFocus: () => void;
5
+ toggleFilter: () => void;
6
+ searchedValue: string;
7
+ placeholder: string;
8
+ };
9
+ declare const SearchInput: FC<TProps>;
10
+ export default SearchInput;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { iconFilter } from "./icons/Icons";
3
+ import style from "./style/FilterBarWrapper.module.css";
4
+ import { cn } from "../../lib/utils/cn";
5
+ const SearchInput = ({ isOpen, onFocus, toggleFilter, searchedValue, placeholder, }) => {
6
+ return (_jsxs("div", { className: cn(style.searchBar, "searchBar", isOpen ? style.searchBarIsOpen : "searchBarIsOpen"), children: [_jsx("input", { type: "text", onChange: () => { }, onFocus: onFocus, value: searchedValue, readOnly: true, placeholder: "Search Anything....", className: cn(style.searchBarInput, "searchBarInput") }), (searchedValue === null || searchedValue === void 0 ? void 0 : searchedValue.length) === 2 && (_jsx("span", { className: cn(style.hasSearchValue, "hasSearchValue"), onClick: toggleFilter, children: placeholder })), _jsx("button", { className: cn(style.icon, "icon", isOpen ? "bg-primary-100" : "iconActive"), onClick: toggleFilter, children: iconFilter() })] }));
7
+ };
8
+ export default SearchInput;
@@ -0,0 +1,2 @@
1
+ export declare const iconFilter: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const iconReset: (className?: string) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const iconFilter = () => {
3
+ return (_jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M3.34605 8.64002C3.79005 8.65002 4.22405 8.65802 4.65605 8.63702C4.67705 8.63602 4.69805 8.63502 4.71905 8.63502C5.07005 8.63502 5.29205 8.78502 5.45705 9.12802C6.27205 10.819 7.59905 11.677 9.40305 11.68C9.40605 11.68 9.40905 11.68 9.41105 11.68C11.198 11.68 12.518 10.833 13.336 9.16302C13.521 8.78402 13.755 8.63602 14.168 8.63602C14.17 8.63602 14.173 8.63602 14.173 8.63602C17.253 8.64602 20.89 8.65202 24.505 8.63002C24.833 8.62702 25.209 8.52302 25.486 8.35802C25.917 8.10002 26.106 7.51902 25.937 6.97502C25.771 6.44602 25.283 6.08902 24.718 6.08702C23.087 6.08102 21.455 6.08202 19.824 6.08402H13.596L13.525 5.94402L13.515 5.92002L13.503 5.89602L13.46 5.81102C12.669 3.98502 11.318 3.05302 9.44405 3.03802C7.58905 3.00902 6.19705 3.93202 5.37605 5.73802C5.28505 5.93702 5.02705 6.06802 4.84105 6.07602C4.52005 6.08902 4.19805 6.08802 3.87605 6.08602C3.70405 6.08402 3.53305 6.08302 3.36105 6.08502C2.57905 6.09002 2.00605 6.62302 2.00005 7.35302C1.99405 8.06902 2.57305 8.62302 3.34605 8.64002ZM8.14105 6.10102C8.47405 5.76302 8.92005 5.57602 9.39805 5.57502C9.40105 5.57502 9.40405 5.57502 9.40405 5.57502C9.87905 5.57502 10.325 5.75802 10.66 6.09202C10.996 6.42702 11.183 6.87502 11.184 7.35302C11.187 8.33702 10.394 9.14302 9.41505 9.15002C9.41005 9.15002 9.40605 9.15002 9.40205 9.15002C8.93505 9.15002 8.49405 8.96802 8.16005 8.63802C7.81805 8.30002 7.62905 7.84902 7.62805 7.36802C7.62605 6.88902 7.80805 6.43902 8.14105 6.10102ZM24.656 19.359C24.211 19.35 23.739 19.342 23.273 19.363C22.868 19.382 22.682 19.154 22.563 18.903C21.74 17.19 20.407 16.321 18.599 16.32H18.596C16.786 16.32 15.452 17.187 14.632 18.895C14.473 19.226 14.262 19.362 13.906 19.362C13.904 19.362 13.901 19.362 13.901 19.362C11.733 19.353 9.56605 19.352 7.39805 19.356L4.87305 19.355C4.36705 19.353 3.86105 19.35 3.35505 19.358C2.69105 19.366 2.17605 19.751 2.04205 20.338C1.95105 20.739 2.03305 21.125 2.27305 21.425C2.51905 21.734 2.91205 21.912 3.34905 21.912C5.89005 21.915 8.43105 21.917 10.97 21.914H14.4L14.471 22.052L14.478 22.07L14.49 22.087C14.513 22.131 14.53 22.164 14.543 22.2C15.336 24.025 16.698 24.959 18.587 24.964C18.591 24.964 18.596 24.964 18.601 24.964C20.456 24.964 21.81 24.056 22.622 22.267C22.713 22.066 22.97 21.934 23.156 21.925C23.481 21.911 23.805 21.911 24.131 21.915C24.301 21.915 24.468 21.918 24.636 21.915C25.419 21.91 25.991 21.377 25.999 20.647C26.008 19.928 25.429 19.374 24.656 19.359ZM18.613 22.422C18.607 22.422 18.601 22.422 18.596 22.422C18.125 22.422 17.683 22.241 17.348 21.912C17.009 21.578 16.819 21.131 16.816 20.653C16.809 19.654 17.582 18.86 18.574 18.846C18.583 18.846 18.592 18.846 18.6 18.846C19.062 18.846 19.499 19.025 19.833 19.352C20.177 19.688 20.369 20.137 20.373 20.618C20.382 21.605 19.592 22.414 18.613 22.422Z", fill: "#130F40" }) }));
4
+ };
5
+ export const iconReset = (className) => {
6
+ return (_jsx("svg", { width: "100%", height: "100%", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: _jsx("path", { d: "M23.4805 19.6821C22.2025 22.4695 20.0742 24.3966 17.1609 25.3979C15.098 26.1124 13.0301 26.1929 11.0124 25.6293C7.45009 24.6381 4.95949 22.384 3.60098 18.9374C3.35947 18.3185 3.67645 17.599 4.31042 17.3324C4.47646 17.2569 4.65257 17.2267 4.82364 17.2267C5.2966 17.2267 5.73938 17.4883 5.96579 17.9412C6.0463 18.1072 6.1268 18.2733 6.20731 18.4443C6.41863 18.8972 6.64002 19.3651 6.93185 19.7877C8.64256 22.2582 11.0174 23.4708 13.9709 23.3903C17.4024 23.2997 20.3308 21.1362 21.4226 17.8808C22.3837 15.0128 21.8956 12.3713 19.9786 10.0165C18.4792 8.17498 16.4565 7.18377 13.976 7.06302C13.6741 7.04792 13.3772 7.07308 13.0854 7.10327C12.9345 7.11333 12.7835 7.12843 12.6326 7.13849C12.5621 7.13849 12.3508 7.14855 12.225 7.31459C12.1093 7.46554 12.1294 7.65171 12.1596 7.79259C12.2401 8.17498 12.3105 8.55235 12.386 8.93474C12.4162 9.09072 12.4464 9.2467 12.4766 9.40268L12.4866 9.46305L12.5168 9.62406C12.5219 9.63413 12.5219 9.63916 12.5219 9.64922C12.5219 9.9008 12.2602 10.092 12.0137 9.98633C12.0087 9.98633 11.9986 9.98633 11.9936 9.9813L6.85134 7.55611C6.81612 7.54101 6.7809 7.52089 6.74568 7.49573C6.36832 7.26931 6.26769 6.76616 6.52932 6.41395C6.54442 6.38879 6.56454 6.36364 6.58467 6.34351L10.4288 2.16735L10.5042 2.08684C10.5093 2.08181 10.5193 2.07678 10.5244 2.06672C10.7156 1.93086 10.9873 2.01137 11.0778 2.22772C11.103 2.34345 11.1231 2.45917 11.1432 2.5749L11.1483 2.58999L11.2891 3.31956C11.3495 3.60133 11.4049 3.8831 11.4502 4.16486C11.5256 4.58751 11.8175 4.63279 12.0489 4.59757C16.9899 3.81265 21.8906 6.62528 23.7019 11.2794C24.8088 14.1172 24.7334 16.9449 23.4805 19.6821Z", fill: "currentColor" }) }));
7
+ };
@@ -0,0 +1,41 @@
1
+ .filterBarContainer {
2
+ @apply bg-white shadow-[0_7px_20px_rgb(174_0_185/5%)] rounded-10 relative z-[1];
3
+ }
4
+ .filterBarContainerDisabled {
5
+ @apply [&_input]:bg-primary-50 [&>div]:!border-primary-100 bg-primary-50 pointer-events-none;
6
+ }
7
+ .expandSection {
8
+ @apply w-full bg-white shadow-[0_7px_20px_rgb(174_0_185/5%)] absolute top-8 left-0 z-30 max-h-0 overflow-hidden transition-[max-height];
9
+ }
10
+ .isExpanded {
11
+ @apply max-h-[600px] rounded-bl-10 rounded-br-10 overflow-visible;
12
+ }
13
+ .form {
14
+ @apply pt-8 px-4 pb-4 space-y-4 border border-secondary-100 border-t-transparent rounded-bl-10 rounded-br-10;
15
+ }
16
+ .buttonContainer {
17
+ @apply flex justify-end gap-2.5;
18
+ }
19
+ .resetBtn {
20
+ @apply rounded-[8px] bg-secondary-100 hover:bg-secondary p-1.5 transition-colors size-[34px];
21
+ }
22
+ .searchBtn {
23
+ @apply relative px-3 h-[34px] text-base font-medium rounded-[8px] transition-colors disabled:bg-primary-100 disabled:pointer-events-none disabled:text-primary-500 w-36 bg-[#AE00B9] text-white;
24
+ }
25
+
26
+ .searchBar {
27
+ @apply flex items-center h-10 overflow-hidden border border-secondary-100 rounded-10 relative z-50;
28
+ }
29
+
30
+ .searchBarIsOpen {
31
+ @apply rounded-[10px_10px_0_0];
32
+ }
33
+ .searchBarInput {
34
+ @apply flex-1 rounded-10 py-2 px-4 focus:outline-none text-xs;
35
+ }
36
+ .hasSearchValue {
37
+ @apply absolute top-1/2 left-4 -translate-y-1/2 text-primary-500;
38
+ }
39
+ .icon {
40
+ @apply w-10 h-[80%] mx-1 px-3 rounded-[5px] hover:bg-primary-100 transition-colors flex justify-center items-center;
41
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./header.css";
3
+ type TFixedHeaderControl = {
4
+ children: React.ReactNode;
5
+ };
6
+ declare const FixedHeaderControl: React.FC<TFixedHeaderControl>;
7
+ export default FixedHeaderControl;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef } from "react";
4
+ import "./header.css";
5
+ const FixedHeaderControl = ({ children }) => {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ const handleScroll = () => {
9
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
10
+ if (typeof window !== "undefined" && window.scrollY > 5) {
11
+ ref.current.classList.add("position-high");
12
+ }
13
+ else {
14
+ ref.current.classList.remove("position-high");
15
+ }
16
+ }
17
+ };
18
+ window.addEventListener("scroll", handleScroll);
19
+ return () => window.removeEventListener("scroll", handleScroll);
20
+ }, []);
21
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "web-header", ref: ref, children: children }), _jsx("div", { className: "web-header-gap" })] }));
22
+ };
23
+ export default FixedHeaderControl;
@@ -0,0 +1,25 @@
1
+ import { FC } from "react";
2
+ type THeaderLoginComp = {
3
+ cartFn: () => {
4
+ cartItems: any[];
5
+ reloadCartData: () => void;
6
+ };
7
+ authFn: () => {
8
+ authInfo: any;
9
+ logOut: () => void;
10
+ loginUrl: string;
11
+ };
12
+ templateFn: () => {
13
+ setMessage: (message: string) => void;
14
+ setConfirm: (confirm: any) => void;
15
+ setTemplateLoading: (loading: boolean) => void;
16
+ };
17
+ removeProductFromCartFn?: (productId: number) => void;
18
+ pathname: string;
19
+ ImageComponent: any;
20
+ LinkComponent: any;
21
+ authWrapper: any;
22
+ applicationData: any;
23
+ };
24
+ declare const HeaderLoginColumnComp: FC<THeaderLoginComp>;
25
+ export default HeaderLoginColumnComp;
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import ProfileManage from "../Profile/ProfileManage";
4
+ import HeaderServiceBtnComp from "./HeaderServiceBtnComp";
5
+ const HeaderLoginColumnComp = ({ cartFn, authFn, templateFn, pathname, ImageComponent, LinkComponent, removeProductFromCartFn, authWrapper, applicationData, }) => {
6
+ const { cartItems, reloadCartData } = cartFn();
7
+ const { authInfo, logOut, loginUrl } = authFn();
8
+ const { setMessage, setConfirm, setTemplateLoading } = templateFn();
9
+ // const removeProductFromCart = (productId: number) => {
10
+ // setConfirm({
11
+ // show: true,
12
+ // text: "Are you sure you want to remove this item from cart?",
13
+ // textCancel: "No",
14
+ // txtAction: "Yes",
15
+ // textActionCname: "!bg-primary-100 !text-primary",
16
+ // clickAction: () => {
17
+ // setMessage("Removing...");
18
+ // setTemplateLoading(true);
19
+ // ApiDeleteCartItem(authInfo, productId)
20
+ // .then(({ message }) => {
21
+ // setMessage(message);
22
+ // reloadCartData();
23
+ // })
24
+ // .catch((err: Error) => {
25
+ // setMessage(err.message);
26
+ // })
27
+ // .finally(() => {
28
+ // setTemplateLoading(false);
29
+ // setConfirm(null);
30
+ // });
31
+ // },
32
+ // });
33
+ // };
34
+ return (_jsxs("ul", { className: "flex items-center justify-end gap-3.5 lg:gap-4", children: [_jsx("li", {}), pathname !== "/cart" ? (_jsx("li", { className: "flex -mx-1" })) : null, _jsx("li", { className: "-mx-1", children: _jsx(HeaderServiceBtnComp, { ImageComponent: ImageComponent, LinkComponent: LinkComponent, applicationData: applicationData, authInfo: authInfo }) }), _jsx("li", { children: _jsx(ProfileManage, { authFn: authFn, AuthCompWrapper: authWrapper, LinkComponent: LinkComponent, ImageComponent: ImageComponent }) })] }));
35
+ };
36
+ export default HeaderLoginColumnComp;
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ declare const HeaderLogoComp: FC<{
3
+ ImageComponent: any;
4
+ LinkComponent: any;
5
+ }>;
6
+ export default HeaderLogoComp;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { headerIcons } from "./icons/icons";
3
+ const HeaderLogoComp = ({ ImageComponent, LinkComponent }) => {
4
+ return (_jsx(LinkComponent, { href: "/", className: "lg:w-auto xl:w-[160px] h-10 xl:h-[50px]", children: _jsx(ImageComponent, { src: headerIcons.iconBikLogo, alt: "logo", width: 0, height: 0, className: "size-full", priority: true }) }));
5
+ };
6
+ export default HeaderLogoComp;
@@ -0,0 +1,21 @@
1
+ import { FC, ReactNode } from "react";
2
+ type THeaderProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ cartFn?: () => {
6
+ cartItems: any[];
7
+ reloadCartData: () => void;
8
+ };
9
+ removeProductFromCartFn?: (id: number) => void;
10
+ ImageComponent: any;
11
+ LinkComponent: any;
12
+ authWrapper: any;
13
+ authFn: () => any;
14
+ templateFn: () => any;
15
+ routerFn: () => any;
16
+ pathname: string;
17
+ applicationData: any;
18
+ navLinks?: any;
19
+ };
20
+ declare const HeaderSection: FC<THeaderProps>;
21
+ export default HeaderSection;