@bikiran/utils 2.0.2 → 2.0.3

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 (54) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +168 -168
  3. package/dist/components/Profile/authTypes.ts +21 -21
  4. package/dist/components/Profile/style/LoginBtn.module.css +6 -6
  5. package/dist/components/Profile/style/ProfileManage.module.css +6 -6
  6. package/dist/components/Profile/style/ProfileMenuList.module.css +50 -50
  7. package/dist/components/Profile/style/ProfileMenuPopup.module.css +30 -30
  8. package/dist/components/Profile/style/ProfileUserInformation.module.css +26 -26
  9. package/dist/components/Profile/style/ProfileView.module.css +12 -12
  10. package/dist/components/button-wrapper/style/style.module.css +18 -18
  11. package/dist/components/cookie-accept-popup/style/CookieAcceptPopup.module.css +12 -12
  12. package/dist/components/copy-wrapper/CopyWrapper.js +5 -1
  13. package/dist/components/currency-selector/style/CurrencySelector.module.css +28 -28
  14. package/dist/components/custom-sidebar/style/CustomSidebar.module.css +21 -21
  15. package/dist/components/filter-wrapper/style/FilterBarWrapper.module.css +41 -41
  16. package/dist/components/header/header.css +61 -61
  17. package/dist/components/header/headerType.ts +15 -15
  18. package/dist/components/header/icons/icon-about-us-submenu.svg +6 -6
  19. package/dist/components/header/icons/icon-about-us.svg +5 -5
  20. package/dist/components/header/icons/icon-all-service.svg +11 -11
  21. package/dist/components/header/icons/icon-arrow-v2.svg +3 -3
  22. package/dist/components/header/icons/icon-bell-fill.svg +3 -3
  23. package/dist/components/header/icons/icon-bik-logo.svg +13 -13
  24. package/dist/components/header/icons/icon-contacts.svg +6 -6
  25. package/dist/components/header/icons/icon-domain.svg +4 -4
  26. package/dist/components/header/icons/icon-hosting.svg +5 -5
  27. package/dist/components/header/icons/icon-our-clients.svg +4 -4
  28. package/dist/components/header/sidebar/SidebarConstants.ts +55 -55
  29. package/dist/components/header/sidebar/sidebarStyle.css +32 -32
  30. package/dist/components/information-tooltip/icons.js +4 -4
  31. package/dist/components/information-tooltip/style/InfoTooltip.module.css +62 -62
  32. package/dist/components/loading-comp/style/LoadingComp.module.css +3 -3
  33. package/dist/components/pageLoading/style/PageLoading.module.css +7 -7
  34. package/dist/components/pagination2/style/Pagination.module.css +27 -27
  35. package/dist/components/project-selector/projectConstants.ts +23 -23
  36. package/dist/components/project-selector/projectTypes.ts +22 -22
  37. package/dist/components/project-selector/selector-icons/icon-arrow-down.svg +3 -3
  38. package/dist/components/project-selector/selector-icons/icon-default-app.svg +9 -9
  39. package/dist/components/services-popup/ServiceAppType.ts +10 -10
  40. package/dist/components/services-popup/icons/icon-account.svg +7 -7
  41. package/dist/components/services-popup/icons/icon-cross.svg +3 -3
  42. package/dist/components/services-popup/icons/icon-default-app.svg +9 -9
  43. package/dist/components/user-info/style/ToolTipUserInfo.module.css +28 -28
  44. package/dist/declaration.d.ts +9 -9
  45. package/dist/index.ts +15 -15
  46. package/dist/lib/types/GlobalType.ts +17 -17
  47. package/dist/lib/utils/Cookie.ts +58 -58
  48. package/dist/lib/utils/Copy.ts +37 -37
  49. package/dist/lib/utils/Env.ts +235 -235
  50. package/dist/lib/utils/capitalizeFirstLetter.ts +7 -7
  51. package/dist/lib/utils/cn.ts +4 -4
  52. package/dist/lib/utils/option.ts +7 -7
  53. package/dist/package.json +1 -1
  54. package/package.json +60 -60
@@ -1,17 +1,17 @@
1
- import React from "react";
2
-
3
- export type TInputChangeEvent = React.ChangeEvent<HTMLInputElement>;
4
-
5
- export type TTextAreaChangeEvent = React.ChangeEvent<HTMLTextAreaElement>;
6
-
7
- export type TMouseEvent = React.MouseEvent<HTMLButtonElement>;
8
-
9
- export type TFormEvent = React.FormEvent<HTMLFormElement>;
10
-
11
- export type TKeyboardEvent = React.KeyboardEvent<HTMLInputElement>;
12
-
13
- export type TFocusEvent = React.FocusEvent<HTMLInputElement>;
14
-
15
- export type TDragEvent = React.DragEvent<HTMLDivElement>;
16
-
17
- export type TState<T> = React.Dispatch<React.SetStateAction<T>>;
1
+ import React from "react";
2
+
3
+ export type TInputChangeEvent = React.ChangeEvent<HTMLInputElement>;
4
+
5
+ export type TTextAreaChangeEvent = React.ChangeEvent<HTMLTextAreaElement>;
6
+
7
+ export type TMouseEvent = React.MouseEvent<HTMLButtonElement>;
8
+
9
+ export type TFormEvent = React.FormEvent<HTMLFormElement>;
10
+
11
+ export type TKeyboardEvent = React.KeyboardEvent<HTMLInputElement>;
12
+
13
+ export type TFocusEvent = React.FocusEvent<HTMLInputElement>;
14
+
15
+ export type TDragEvent = React.DragEvent<HTMLDivElement>;
16
+
17
+ export type TState<T> = React.Dispatch<React.SetStateAction<T>>;
@@ -1,58 +1,58 @@
1
- import { getBaseDomain } from "./Env";
2
-
3
- class Cookie {
4
- cname: string;
5
- domain: string;
6
- path: string;
7
-
8
- constructor(
9
- cname: string,
10
- domain: string = getBaseDomain(),
11
- path: string = "/"
12
- ) {
13
- this.cname = cname;
14
- this.domain = domain;
15
- this.path = path;
16
- }
17
-
18
- setCookie(cValue: string, exDays: number): void {
19
- if (typeof document !== "undefined") {
20
- const d = new Date();
21
- d.setTime(d.getTime() + exDays * 24 * 60 * 60 * 1000);
22
- const expires = "expires=" + d.toUTCString();
23
- document.cookie = `${this.cname}=${cValue};${expires};path=${this.path};domain=${this.domain};`;
24
- } else {
25
- console.warn("document is not available. Skipping cookie set.");
26
- }
27
- }
28
-
29
- getCookie(): string {
30
- if (typeof document !== "undefined") {
31
- const name = this.cname + "=";
32
- const decodedCookie = decodeURIComponent(document.cookie);
33
- const ca = decodedCookie.split(";");
34
- for (let i = 0; i < ca.length; i++) {
35
- let c = ca[i].trim();
36
- if (c.indexOf(name) === 0) {
37
- return c.substring(name.length, c.length);
38
- }
39
- }
40
- }
41
- return "";
42
- }
43
-
44
- verifyCookie(cValue: string): boolean {
45
- const cookieValue = this.getCookie();
46
- return cookieValue === cValue;
47
- }
48
-
49
- deleteCookie(): void {
50
- if (typeof document !== "undefined") {
51
- document.cookie = `${this.cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${this.path};domain=${this.domain};`;
52
- } else {
53
- console.warn("document is not available. Skipping cookie deletion.");
54
- }
55
- }
56
- }
57
-
58
- export default Cookie;
1
+ import { getBaseDomain } from "./Env";
2
+
3
+ class Cookie {
4
+ cname: string;
5
+ domain: string;
6
+ path: string;
7
+
8
+ constructor(
9
+ cname: string,
10
+ domain: string = getBaseDomain(),
11
+ path: string = "/"
12
+ ) {
13
+ this.cname = cname;
14
+ this.domain = domain;
15
+ this.path = path;
16
+ }
17
+
18
+ setCookie(cValue: string, exDays: number): void {
19
+ if (typeof document !== "undefined") {
20
+ const d = new Date();
21
+ d.setTime(d.getTime() + exDays * 24 * 60 * 60 * 1000);
22
+ const expires = "expires=" + d.toUTCString();
23
+ document.cookie = `${this.cname}=${cValue};${expires};path=${this.path};domain=${this.domain};`;
24
+ } else {
25
+ console.warn("document is not available. Skipping cookie set.");
26
+ }
27
+ }
28
+
29
+ getCookie(): string {
30
+ if (typeof document !== "undefined") {
31
+ const name = this.cname + "=";
32
+ const decodedCookie = decodeURIComponent(document.cookie);
33
+ const ca = decodedCookie.split(";");
34
+ for (let i = 0; i < ca.length; i++) {
35
+ let c = ca[i].trim();
36
+ if (c.indexOf(name) === 0) {
37
+ return c.substring(name.length, c.length);
38
+ }
39
+ }
40
+ }
41
+ return "";
42
+ }
43
+
44
+ verifyCookie(cValue: string): boolean {
45
+ const cookieValue = this.getCookie();
46
+ return cookieValue === cValue;
47
+ }
48
+
49
+ deleteCookie(): void {
50
+ if (typeof document !== "undefined") {
51
+ document.cookie = `${this.cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${this.path};domain=${this.domain};`;
52
+ } else {
53
+ console.warn("document is not available. Skipping cookie deletion.");
54
+ }
55
+ }
56
+ }
57
+
58
+ export default Cookie;
@@ -1,37 +1,37 @@
1
- "use client";
2
- import { useState } from "react";
3
-
4
- // USAGE:
5
- // call the copy function with the text you want to copy
6
- /*
7
- const { copy, isCopied } = Copy();
8
-
9
- // call the copy function with the text you want to copy
10
- onClick={() => copy("text to copy")}
11
-
12
- // show a message if the text is copied
13
- {isCopied && <div>Copied</div>}
14
- */
15
-
16
- function Copy() {
17
- const [isCopied, setIsCopied] = useState(false);
18
-
19
- const copy = (text: any) => {
20
- navigator.clipboard
21
- .writeText(text)
22
- .then(() => {
23
- // setMessage("Copied");
24
- setIsCopied(true);
25
- setTimeout(() => {
26
- setIsCopied(false);
27
- }, 1000);
28
- })
29
- .catch((error) => {
30
- console.error("Error copying text to clipboard:", error);
31
- });
32
- };
33
-
34
- return { copy, isCopied };
35
- }
36
-
37
- export default Copy;
1
+ "use client";
2
+ import { useState } from "react";
3
+
4
+ // USAGE:
5
+ // call the copy function with the text you want to copy
6
+ /*
7
+ const { copy, isCopied } = Copy();
8
+
9
+ // call the copy function with the text you want to copy
10
+ onClick={() => copy("text to copy")}
11
+
12
+ // show a message if the text is copied
13
+ {isCopied && <div>Copied</div>}
14
+ */
15
+
16
+ function Copy() {
17
+ const [isCopied, setIsCopied] = useState(false);
18
+
19
+ const copy = (text: any) => {
20
+ navigator.clipboard
21
+ .writeText(text)
22
+ .then(() => {
23
+ // setMessage("Copied");
24
+ setIsCopied(true);
25
+ setTimeout(() => {
26
+ setIsCopied(false);
27
+ }, 1000);
28
+ })
29
+ .catch((error) => {
30
+ console.error("Error copying text to clipboard:", error);
31
+ });
32
+ };
33
+
34
+ return { copy, isCopied };
35
+ }
36
+
37
+ export default Copy;