gbs-add-block 0.0.1

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 (37) hide show
  1. package/index.js +108 -0
  2. package/package.json +28 -0
  3. package/source/components/button/index.tsx +25 -0
  4. package/source/components/checkbox/index.tsx +9 -0
  5. package/source/components/darkmode/index.tsx +48 -0
  6. package/source/components/datepicker/DatePickerHelper.ts +42 -0
  7. package/source/components/datepicker/index.tsx +258 -0
  8. package/source/components/datepicker/types.ts +9 -0
  9. package/source/components/dialog/index.tsx +44 -0
  10. package/source/components/dialog/types.ts +12 -0
  11. package/source/components/grid/FilterPopup.tsx +85 -0
  12. package/source/components/grid/Grid.tsx +615 -0
  13. package/source/components/grid/GridHelperFunctions.ts +218 -0
  14. package/source/components/grid/index.tsx +26 -0
  15. package/source/components/grid/type.ts +28 -0
  16. package/source/components/input/index.tsx +105 -0
  17. package/source/components/input/types.ts +9 -0
  18. package/source/components/modal/index.tsx +58 -0
  19. package/source/components/modal/types.ts +11 -0
  20. package/source/components/multiselect/index.tsx +213 -0
  21. package/source/components/multiselect/types.ts +14 -0
  22. package/source/components/select/index.tsx +220 -0
  23. package/source/components/select/types.ts +13 -0
  24. package/source/components/spinner/Stroke.tsx +89 -0
  25. package/source/components/spinner/index.tsx +54 -0
  26. package/source/components/spinner/types.ts +9 -0
  27. package/source/components/toast/Toast.tsx +61 -0
  28. package/source/components/toast/index.tsx +36 -0
  29. package/source/components/toast/toastAtom.ts +23 -0
  30. package/source/components/toast/types.ts +24 -0
  31. package/source/components/toast/useToast.ts +24 -0
  32. package/source/fallback/index.tsx +11 -0
  33. package/source/icon/Icon.tsx +55 -0
  34. package/source/icon/iconPaths.ts +92 -0
  35. package/source/index.ts +15 -0
  36. package/source/types.ts +108 -0
  37. package/source/utils.ts +10 -0
@@ -0,0 +1,92 @@
1
+ // Add Icon paths here and refer it in with <Icon /> component
2
+
3
+ export const leftArrows: any = [
4
+ { type: "path", d: "m11 17-5-5 5-5", key: "13zhaf" },
5
+ { type: "path", d: "m18 17-5-5 5-5", key: "h8a8et" },
6
+ ];
7
+ export const leftArrow: any = [
8
+ { type: "path", d: "m11 17-5-5 5-5", key: "13zhaf" },
9
+ ];
10
+ export const rightArrow: any = [
11
+ { type: "path", d: "m9 18 6-6-6-6", key: "mthhwq" },
12
+ ];
13
+ export const rightArrows: any = [
14
+ { type: "path", d: "m6 17 5-5-5-5", key: "xnjwq" },
15
+ { type: "path", d: "m13 17 5-5-5-5", key: "17xmmf" },
16
+ ];
17
+ export const search: any = [
18
+ { type: "circle", cx: "11", cy: "11", r: "8", key: "4ej97u" },
19
+ { type: "path", d: "m21 21-4.3-4.3", key: "1qie3q" },
20
+ ];
21
+ export const listFilter: any = [
22
+ { type: "path", d: "M3 6h18", key: "d0wm0j" },
23
+ { type: "path", d: "M7 12h10", key: "b7w52i" },
24
+ { type: "path", d: "M10 18h4", key: "1ulq68" },
25
+ ];
26
+ export const down: any = [{ type: "path", d: "m6 9 6 6 6-6", key: "qrunsl" }];
27
+ export const calender: any = [
28
+ { type: "path", d: "M8 2v4", key: "1cmpym" },
29
+ { type: "path", d: "M16 2v4", key: "4m81vk" },
30
+
31
+ {
32
+ type: "rect",
33
+ width: "18",
34
+ height: "18",
35
+ x: "3",
36
+ y: "4",
37
+ rx: "2",
38
+ key: "1hopcy",
39
+ },
40
+ ,
41
+ { type: "path", d: "M3 10h18", key: "8toen8" },
42
+ ];
43
+ export let upDown: any = [
44
+ { type: "path", d: "m7 15 5 5 5-5", key: "1hf1tw" },
45
+ { type: "path", d: "m7 9 5-5 5 5", key: "sgt6xg" },
46
+ ];
47
+ export let x: any = [
48
+ { type: "path", d: "M18 6 6 18", key: "1bl5f8" },
49
+ { type: "path", d: "m6 6 12 12", key: "d8bk6v" },
50
+ ];
51
+ export let check: any = [{ type: "path", d: "M20 6 9 17l-5-5", key: "1gmf2c" }];
52
+ export let eye: any = [
53
+ {
54
+ type: "path",
55
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
56
+ key: "1nclc0",
57
+ },
58
+ { type: "circle", cx: "12", cy: "12", r: "3", key: "1v7zrd" },
59
+ ];
60
+
61
+ export let circleCheck: any = [
62
+ { type: "path", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", key: "g774vq" },
63
+ { type: "path", d: "m9 11 3 3L22 4", key: "1pflzl" },
64
+ ];
65
+
66
+ export let xCircle: any = [
67
+ { type: "circle", cx: "12", cy: "12", r: "10", key: "1mglay" },
68
+ { type: "path", d: "m15 9-6 6", key: "1uzhvr" },
69
+ { type: "path", d: "m9 9 6 6", key: "z0biqf" },
70
+ ];
71
+
72
+ export let info: any = [
73
+ { type: "circle", cx: "12", cy: "12", r: "10", key: "1mglay" },
74
+ { type: "path", d: "M12 16v-4", key: "1dtifu" },
75
+ { type: "path", d: "M12 8h.01", key: "e9boi3" },
76
+ ];
77
+
78
+ export let sun: any = [
79
+ { type: "circle", cx: "12", cy: "12", r: "4", key: "4exip2" },
80
+ { type: "path", d: "M12 20v2", key: "1lh1kg" },
81
+ { type: "path", d: "M12 2v2", key: "tus03m" },
82
+ { type: "path", d: "m4.93 4.93 1.41 1.41", key: "149t6j" },
83
+ { type: "path", d: "m17.66 17.66 1.41 1.41", key: "ptbguv" },
84
+ { type: "path", d: "M2 12h2", key: "1t8f8n" },
85
+ { type: "path", d: "M20 12h2", key: "1q8mjw" },
86
+ { type: "path", d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" },
87
+ { type: "path", d: "m19.07 4.93-1.41 1.41", key: "1shlcs" },
88
+ ];
89
+
90
+ export let moon: any = [
91
+ { type: "path", d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" },
92
+ ];
@@ -0,0 +1,15 @@
1
+ // Re-Export Components here
2
+ export * from "./components/grid/Grid";
3
+ export * from "./components/datepicker";
4
+ export * from "./components/dialog";
5
+ export * from "./components/darkmode";
6
+ export * from "./components/select";
7
+ export * from "./components/input";
8
+ export * from "./components/button";
9
+ export * from "./components/multiselect";
10
+ export * from "./components/spinner";
11
+ export * from "./components/dialog";
12
+ export * from "./components/modal";
13
+ export * from "./components/toast";
14
+ export * from "./components/checkbox";
15
+ export { default as useToast } from "./components/toast/useToast";
@@ -0,0 +1,108 @@
1
+ import { InputHTMLAttributes } from "react";
2
+
3
+ // Sepecify types for components here
4
+ interface PageSettingsProps {
5
+ pageNumber: number;
6
+ }
7
+
8
+ export type GridProps = {
9
+ dataSource: any[] | string;
10
+ columns?: any[];
11
+ pageSettings: PageSettingsProps;
12
+ enableSearch?: boolean;
13
+ lazy?: boolean;
14
+ enableExcelExport?: boolean;
15
+ excelName?: string;
16
+ enablePdfExport?: boolean;
17
+ pdfName?: string;
18
+ gridContainerClass?: string;
19
+ gridButtonClass?: string;
20
+ gridHeaderClass?: string;
21
+ gridGlobalSearchButtonClass?: string;
22
+ gridPaginationButtonClass?: string;
23
+ pdfOptions?: any;
24
+ isFetching?: boolean;
25
+ showPagination?: boolean;
26
+ selectAll?: boolean;
27
+ onSelectRow?: (value: any) => void;
28
+ tableHeaderStyle?: string;
29
+ gridColumnStyleSelectAll?: string;
30
+ gridColumnStyle?: string;
31
+ };
32
+
33
+ export type DatePickerProps = {
34
+ placeholder?: string | undefined;
35
+ selectedDate?: Date;
36
+ minDate?: Date | null;
37
+ maxDate?: Date | null;
38
+ yearLimitStart?: number;
39
+ yearLimitEnd?: number;
40
+ onDateChange?: any;
41
+ };
42
+
43
+ interface ItemsProps {
44
+ value: string;
45
+ label: string;
46
+ }
47
+
48
+ export type SelectProps = {
49
+ placeholder?: string;
50
+ items?: ItemsProps[] | string;
51
+ lazy?: boolean;
52
+ showSearch?: boolean;
53
+ onSelect?: any;
54
+ selectedItem?: string;
55
+ };
56
+
57
+ export type InputProps = {
58
+ OTPField?: boolean;
59
+ OTPValue?: string;
60
+ OTPLength?: number;
61
+ OTPClass?: string;
62
+ onOTPValueChange?: (value: string) => void;
63
+ } & InputHTMLAttributes<HTMLInputElement>;
64
+
65
+ export type MultiSelectProps = {
66
+ placeholder?: string;
67
+ items?: ItemsProps[] | string;
68
+ lazy?: boolean;
69
+ showSearch?: boolean;
70
+ onSelect?: any;
71
+ truncate?: boolean;
72
+ selectedItems?: string[];
73
+ };
74
+
75
+ export type SpinnerProps = {
76
+ size?: string;
77
+ color?: string;
78
+ fullCircleColor?: string;
79
+ dotColor?: string;
80
+ duration?: string;
81
+ type?: "circle" | "circle-bg" | "dot" | "stroke";
82
+ strokeColor?: string;
83
+ };
84
+
85
+ export type ModalProps = {
86
+ showModal?: boolean;
87
+ modalTitle?: string;
88
+ autoclose?: boolean;
89
+ modalClass?: string;
90
+ modalContentClass?: string;
91
+ classModalContent?: string;
92
+ modalTitleClass?: string;
93
+ classModalTitle?: string;
94
+ children?: React.ReactNode;
95
+ };
96
+
97
+ export type DialogProps = {
98
+ showDialog?: boolean;
99
+ dialogMessage?: string;
100
+ dialogActionOne?: string;
101
+ dialogActionTwo?: string;
102
+ onDialogActionOneClick?: () => void;
103
+ onDialogActionTwoClick?: () => void;
104
+ dialogClass?: string;
105
+ dialogContentClass?: string;
106
+ dialogActionOneStyle?: string;
107
+ dialogActionTwoStyle?: string;
108
+ };
@@ -0,0 +1,10 @@
1
+ // Common util functions
2
+ export async function getSourceData(apiURl: any) {
3
+ try {
4
+ const res = await fetch(apiURl);
5
+ const data = await res.json();
6
+ return data;
7
+ } catch (error) {
8
+ console.error("Error Fetching Data", error);
9
+ }
10
+ }