@instincthub/react-ui 0.0.5 → 0.0.7
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/README.md +4 -3
- package/dist/src/assets/css/bootstrap/display.css +21 -0
- package/dist/src/assets/css/bootstrap/readme/display.md +20 -0
- package/dist/src/assets/css/forms/input-fields.css +3 -2
- package/dist/src/assets/css/main.css +3 -3
- package/dist/src/assets/css/modals/modal-updates.css +6 -3
- package/dist/src/assets/css/modals/modal.css +1 -1
- package/dist/src/assets/css/navbar/sidenav.css +8 -0
- package/dist/src/assets/css/ui/content-viewer.css +1 -0
- package/dist/src/assets/css/ui/create-button.css +140 -0
- package/dist/src/assets/css/ui/pagination.css +359 -0
- package/dist/src/assets/css/ui/ui-index.css +2 -0
- package/dist/src/components/auth/LoginForm.js +1 -1
- package/dist/src/components/auth/ReactClientProviders.js +1 -1
- package/dist/src/components/forms/CheckBoxes.js +2 -0
- package/dist/src/components/forms/CheckBoxes.js.map +1 -0
- package/dist/src/components/forms/ChipsInput.js +1 -1
- package/dist/src/components/forms/FileField.js +2 -0
- package/dist/src/components/forms/FileField.js.map +1 -0
- package/dist/src/components/forms/FilterArray.js +1 -1
- package/dist/src/components/forms/FilterObjects.js +1 -1
- package/dist/src/components/forms/SearchField.js +1 -1
- package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
- package/dist/src/components/forms/TextArea.js +1 -1
- package/dist/src/components/forms/TextArea.js.map +1 -1
- package/dist/src/components/lib/auth/actions.js +1 -1
- package/dist/src/components/lib/auth/dbRequestst.js +1 -1
- package/dist/src/components/lib/auth/dbRequestst.js.map +1 -1
- package/dist/src/components/lib/convertArrayToObject.js +2 -0
- package/dist/src/components/lib/convertArrayToObject.js.map +1 -0
- package/dist/src/components/lib/createSubscription.js +2 -0
- package/dist/src/components/lib/createSubscription.js.map +1 -0
- package/dist/src/components/lib/elementIsVisibleInViewport.js +2 -0
- package/dist/src/components/lib/elementIsVisibleInViewport.js.map +1 -0
- package/dist/src/components/lib/fileToBase64.js +2 -0
- package/dist/src/components/lib/fileToBase64.js.map +1 -0
- package/dist/src/components/lib/formError.js +2 -0
- package/dist/src/components/lib/formError.js.map +1 -0
- package/dist/src/components/lib/getPriceObjects.js +2 -0
- package/dist/src/components/lib/getPriceObjects.js.map +1 -0
- package/dist/src/components/lib/helpFunction.js +1 -1
- package/dist/src/components/lib/helpFunction.js.map +1 -1
- package/dist/src/components/lib/index.js +1 -1
- package/dist/src/components/lib/index.js.map +1 -1
- package/dist/src/components/lib/modals/modals.js +1 -1
- package/dist/src/components/lib/modals/modals.js.map +1 -1
- package/dist/src/components/lib/paystack.js.map +1 -1
- package/dist/src/components/lib/permissions.js +1 -1
- package/dist/src/components/lib/permissions.js.map +1 -1
- package/dist/src/components/lib/queryParameters/index.js +2 -0
- package/dist/src/components/lib/queryParameters/index.js.map +1 -0
- package/dist/src/components/lib/redux/index.js +1 -1
- package/dist/src/components/lib/redux/rootReducer.js +1 -1
- package/dist/src/components/lib/redux/rootReducer.js.map +1 -1
- package/dist/src/components/lib/redux/slices/authSlice/selectors.js +2 -0
- package/dist/src/components/lib/redux/slices/authSlice/selectors.js.map +1 -0
- package/dist/src/components/lib/redux/slices/generics/arraySlice.js +2 -0
- package/dist/src/components/lib/redux/slices/generics/arraySlice.js.map +1 -0
- package/dist/src/components/lib/redux/slices/generics/objectSlice.js +2 -0
- package/dist/src/components/lib/redux/slices/generics/objectSlice.js.map +1 -0
- package/dist/src/components/lib/redux/slices/generics/selectors.js +2 -0
- package/dist/src/components/lib/redux/slices/generics/selectors.js.map +1 -0
- package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
- package/dist/src/components/navbar/SideNavbar.js +1 -1
- package/dist/src/components/status/DeleteConfirmationModal.js +1 -1
- package/dist/src/components/status/ModalExamples.js +1 -1
- package/dist/src/components/status/MultiPurposeModal.js +1 -1
- package/dist/src/components/status/ReactTimeTracker.js +1 -1
- package/dist/src/components/ui/ComponentLists.js +2 -0
- package/dist/src/components/ui/ComponentLists.js.map +1 -0
- package/dist/src/components/ui/create-button/CreateButton.js +2 -0
- package/dist/src/components/ui/create-button/CreateButton.js.map +1 -0
- package/dist/src/components/ui/create-button/CreateButtonExample.js +2 -0
- package/dist/src/components/ui/create-button/CreateButtonExample.js.map +1 -0
- package/dist/src/components/ui/editor/CustomTextEditor.js +1 -1
- package/dist/src/components/ui/pagination/Pagination.js +2 -0
- package/dist/src/components/ui/pagination/Pagination.js.map +1 -0
- package/dist/src/components/ui/pagination/PaginationDemo.js +2 -0
- package/dist/src/components/ui/pagination/PaginationDemo.js.map +1 -0
- package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/components/auth/LoginForm.d.ts +3 -1
- package/dist/src/types/components/auth/index.d.ts +5 -0
- package/dist/src/types/components/forms/CheckBoxes.d.ts +33 -6
- package/dist/src/types/components/forms/CheckboxesField.d.ts +24 -1
- package/dist/src/types/components/forms/FileField.d.ts +8 -4
- package/dist/src/types/components/forms/FilterArray.d.ts +12 -2
- package/dist/src/types/components/forms/FilterObjects.d.ts +11 -3
- package/dist/src/types/components/forms/SearchField.d.ts +16 -0
- package/dist/src/types/components/forms/SearchObjectsFromDB.d.ts +3 -3
- package/dist/src/types/components/forms/TextArea.d.ts +12 -0
- package/dist/src/types/components/forms/index.d.ts +49 -0
- package/dist/src/types/components/lib/auth/dbRequestst.d.ts +2 -0
- package/dist/src/types/components/lib/convertArrayToObject.d.ts +30 -0
- package/dist/src/types/components/lib/helpFunction.d.ts +4 -0
- package/dist/src/types/components/lib/index.d.ts +7 -6
- package/dist/src/types/components/lib/modals/modals.d.ts +2 -1
- package/dist/src/types/components/lib/permissions.d.ts +12 -1
- package/dist/src/types/components/lib/queryParameters/index.d.ts +103 -0
- package/dist/src/types/components/lib/redux/rootReducer.d.ts +2 -0
- package/dist/src/types/components/lib/redux/slices/generics/arraySlice.d.ts +20 -0
- package/dist/src/types/components/lib/redux/slices/generics/index.d.ts +2 -0
- package/dist/src/types/components/lib/redux/slices/generics/objectSlice.d.ts +12 -0
- package/dist/src/types/components/lib/redux/slices/generics/selectors.d.ts +3 -0
- package/dist/src/types/components/lib/redux/slices/index.d.ts +2 -0
- package/dist/src/types/components/lib/redux/slices/selectors.d.ts +5 -0
- package/dist/src/types/components/lib/redux/store.d.ts +6 -0
- package/dist/src/types/components/navbar/index.d.ts +5 -0
- package/dist/src/types/components/status/MultiPurposeModal.d.ts +27 -10
- package/dist/src/types/components/status/index.d.ts +11 -0
- package/dist/src/types/components/tabs/index.d.ts +3 -0
- package/dist/src/types/components/theme/index.d.ts +6 -0
- package/dist/src/types/components/ui/create-button/CreateButton.d.ts +54 -0
- package/dist/src/types/components/ui/create-button/CreateButtonExample.d.ts +3 -0
- package/dist/src/types/components/ui/editor/CustomTextEditor.d.ts +7 -3
- package/dist/src/types/components/ui/index.d.ts +16 -0
- package/dist/src/types/components/ui/pagination/Pagination.d.ts +8 -0
- package/dist/src/types/components/ui/pagination/PaginationDemo.d.ts +3 -0
- package/dist/src/types/index.d.ts +9 -3
- package/dist/src/types/types/index.d.ts +42 -5
- package/dist/src/types/types/navbar.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -2
- package/dist/src/components/ComponentLists.js +0 -2
- package/dist/src/components/ComponentLists.js.map +0 -1
- /package/dist/src/types/components/{ComponentLists.d.ts → ui/ComponentLists.d.ts} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL Query Parameter Helper for InstinctHub React UI
|
|
3
|
+
* Handles adding, updating, removing, and manipulating URL query parameters
|
|
4
|
+
*/
|
|
5
|
+
import { QueryContextType } from "@/types";
|
|
6
|
+
interface QueryParams {
|
|
7
|
+
[key: string]: string | string[] | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface UrlHelperOptions {
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
preserveHash?: boolean;
|
|
12
|
+
encode?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Main URL query parameter helper function
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* urlQueryHelper({ key: "page", value: 1, action: "add" });
|
|
19
|
+
* ```
|
|
20
|
+
* @param context - Object containing key, value, and action
|
|
21
|
+
* @param options - Additional configuration options
|
|
22
|
+
* @returns Updated URL string
|
|
23
|
+
*/
|
|
24
|
+
export declare function urlQueryHelper(context: QueryContextType, options?: UrlHelperOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get all query parameters as an object
|
|
27
|
+
* @param url - URL string to parse (defaults to current URL)
|
|
28
|
+
* @returns Object with query parameters
|
|
29
|
+
*/
|
|
30
|
+
export declare function getQueryParams(url?: string): QueryParams;
|
|
31
|
+
/**
|
|
32
|
+
* Get specific query parameter value
|
|
33
|
+
* @param key - Parameter key to retrieve
|
|
34
|
+
* @param url - URL string to parse (defaults to current URL)
|
|
35
|
+
* @returns Parameter value or null if not found
|
|
36
|
+
*/
|
|
37
|
+
export declare function getQueryParam(key: string, url?: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a query parameter exists
|
|
40
|
+
* @param key - Parameter key to check
|
|
41
|
+
* @param url - URL string to parse (defaults to current URL)
|
|
42
|
+
* @returns Boolean indicating if parameter exists
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasQueryParam(key: string, url?: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Build URL from base path and parameters object
|
|
47
|
+
* @param basePath - Base URL or path
|
|
48
|
+
* @param params - Object of parameters to add
|
|
49
|
+
* @param options - Additional configuration
|
|
50
|
+
* @returns Complete URL string
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildUrl(basePath: string, params: QueryParams, options?: UrlHelperOptions): string;
|
|
53
|
+
/**
|
|
54
|
+
* Navigate to URL with updated query parameters (client-side only)
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* navigateWithQuery({ key: "page", value: 1, action: "add" });
|
|
58
|
+
* ```
|
|
59
|
+
* @param context - Query context for manipulation
|
|
60
|
+
* @param options - Navigation options
|
|
61
|
+
*/
|
|
62
|
+
export declare function navigateWithQuery(context: QueryContextType, options?: UrlHelperOptions & {
|
|
63
|
+
replace?: boolean;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* InstinctHub-specific helper for course filtering
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* buildDataFilterUrl({ subject: "Math", level: "100", instructor: "John Doe" });
|
|
70
|
+
* ```
|
|
71
|
+
* @param filters - Course filter parameters
|
|
72
|
+
* @returns URL with course filters applied
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildDataFilterUrl(filters: {
|
|
75
|
+
subject?: string;
|
|
76
|
+
level?: string;
|
|
77
|
+
instructor?: string;
|
|
78
|
+
search?: string;
|
|
79
|
+
page?: number;
|
|
80
|
+
sort?: string;
|
|
81
|
+
}): string;
|
|
82
|
+
/**
|
|
83
|
+
* InstinctHub-specific helper for pagination
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* buildPaginationUrl(1);
|
|
87
|
+
* ```
|
|
88
|
+
* @param page - Page number
|
|
89
|
+
* @param preserveFilters - Whether to keep existing filters
|
|
90
|
+
* @returns URL with pagination applied
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildPaginationUrl(page: number, preserveFilters?: boolean): string;
|
|
93
|
+
/**
|
|
94
|
+
* Clean URL by removing empty or null parameters
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* cleanUrl();
|
|
98
|
+
* ```
|
|
99
|
+
* @param url - URL to clean (defaults to current URL)
|
|
100
|
+
* @returns Cleaned URL string
|
|
101
|
+
*/
|
|
102
|
+
export declare function cleanUrl(url?: string): string;
|
|
103
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const reducer: {
|
|
2
|
+
objectSlice: import("redux").Reducer<import("./slices/generics/objectSlice").ObjectState, import("redux").UnknownAction, import("./slices/generics/objectSlice").ObjectState>;
|
|
3
|
+
arraySlice: import("redux").Reducer<import("./slices/generics/arraySlice").ArrayState<any>, import("redux").UnknownAction, import("./slices/generics/arraySlice").ArrayState<any>>;
|
|
2
4
|
subjects: import("redux").Reducer<import("../../../types/redux").courseFilterSubjectSliceState, import("redux").UnknownAction, import("../../../types/redux").courseFilterSubjectSliceState>;
|
|
3
5
|
levels: import("redux").Reducer<import("../../../types/redux").courseFilterLevelSliceState, import("redux").UnknownAction, import("../../../types/redux").courseFilterLevelSliceState>;
|
|
4
6
|
durations: import("redux").Reducer<import("../../../types/redux").courseFilterDurationSliceState, import("redux").UnknownAction, import("../../../types/redux").courseFilterDurationSliceState>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
interface ArrayState<T = any> {
|
|
3
|
+
value: T[];
|
|
4
|
+
status: "idle" | "loading" | "failed";
|
|
5
|
+
}
|
|
6
|
+
export declare const arraySlice: import("@reduxjs/toolkit").Slice<ArrayState<any>, {
|
|
7
|
+
setArray(state: import("immer").WritableDraft<ArrayState<any>>, action: PayloadAction<any[]>): void;
|
|
8
|
+
addToArray(state: import("immer").WritableDraft<ArrayState<any>>, action: PayloadAction<any>): void;
|
|
9
|
+
removeFromArray(state: import("immer").WritableDraft<ArrayState<any>>, action: PayloadAction<number>): void;
|
|
10
|
+
clearArray(state: import("immer").WritableDraft<ArrayState<any>>): void;
|
|
11
|
+
updateInArray(state: import("immer").WritableDraft<ArrayState<any>>, action: PayloadAction<{
|
|
12
|
+
index: number;
|
|
13
|
+
value: any;
|
|
14
|
+
}>): void;
|
|
15
|
+
}, "array", "array", import("@reduxjs/toolkit").SliceSelectors<ArrayState<any>>>;
|
|
16
|
+
export declare const setArray: import("@reduxjs/toolkit").ActionCreatorWithPayload<any[], "array/setArray">, addToArray: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "array/addToArray">, removeFromArray: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "array/removeFromArray">, clearArray: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"array/clearArray">, updateInArray: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
|
+
index: number;
|
|
18
|
+
value: any;
|
|
19
|
+
}, "array/updateInArray">;
|
|
20
|
+
export type { ArrayState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
interface ObjectState {
|
|
3
|
+
value: Record<string, any>;
|
|
4
|
+
status: "idle" | "loading" | "failed";
|
|
5
|
+
}
|
|
6
|
+
export declare const objectSlice: import("@reduxjs/toolkit").Slice<ObjectState, {
|
|
7
|
+
setObject(state: import("immer").WritableDraft<ObjectState>, action: PayloadAction<Record<string, any>>): void;
|
|
8
|
+
updateObject(state: import("immer").WritableDraft<ObjectState>, action: PayloadAction<Partial<Record<string, any>>>): void;
|
|
9
|
+
clearObject(state: import("immer").WritableDraft<ObjectState>): void;
|
|
10
|
+
}, "object", "object", import("@reduxjs/toolkit").SliceSelectors<ObjectState>>;
|
|
11
|
+
export declare const setObject: import("@reduxjs/toolkit").ActionCreatorWithPayload<Record<string, any>, "object/setObject">, updateObject: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<Record<string, any>>, "object/updateObject">, clearObject: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"object/clearObject">;
|
|
12
|
+
export type { ObjectState };
|
|
@@ -2,6 +2,8 @@ import { type ConfigureStoreOptions, type ThunkAction, type Action } from '@redu
|
|
|
2
2
|
import { type TypedUseSelectorHook } from 'react-redux';
|
|
3
3
|
export declare const makeReduxStore: (options?: ConfigureStoreOptions) => import("redux").Store<any, import("redux").UnknownAction, unknown>;
|
|
4
4
|
export declare const reduxStore: import("@reduxjs/toolkit").EnhancedStore<{
|
|
5
|
+
objectSlice: import("./slices/generics/objectSlice").ObjectState;
|
|
6
|
+
arraySlice: import("./slices/generics/arraySlice").ArrayState<any>;
|
|
5
7
|
subjects: import("../../../types/redux").courseFilterSubjectSliceState;
|
|
6
8
|
levels: import("../../../types/redux").courseFilterLevelSliceState;
|
|
7
9
|
durations: import("../../../types/redux").courseFilterDurationSliceState;
|
|
@@ -26,6 +28,8 @@ export declare const reduxStore: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
26
28
|
channelHandle: import("./slices").channelHandleSliceState;
|
|
27
29
|
}, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
28
30
|
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
31
|
+
objectSlice: import("./slices/generics/objectSlice").ObjectState;
|
|
32
|
+
arraySlice: import("./slices/generics/arraySlice").ArrayState<any>;
|
|
29
33
|
subjects: import("../../../types/redux").courseFilterSubjectSliceState;
|
|
30
34
|
levels: import("../../../types/redux").courseFilterLevelSliceState;
|
|
31
35
|
durations: import("../../../types/redux").courseFilterDurationSliceState;
|
|
@@ -51,6 +55,8 @@ export declare const reduxStore: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
51
55
|
}, undefined, import("redux").UnknownAction>;
|
|
52
56
|
}, {}>, import("redux").StoreEnhancer<{}, {}>]>>;
|
|
53
57
|
export declare const useDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
58
|
+
objectSlice: import("./slices/generics/objectSlice").ObjectState;
|
|
59
|
+
arraySlice: import("./slices/generics/arraySlice").ArrayState<any>;
|
|
54
60
|
subjects: import("../../../types/redux").courseFilterSubjectSliceState;
|
|
55
61
|
levels: import("../../../types/redux").courseFilterLevelSliceState;
|
|
56
62
|
durations: import("../../../types/redux").courseFilterDurationSliceState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ChannelListAvatar } from "./ChannelListAvatar";
|
|
2
|
+
export { default as MenuDropdown } from "./MenuDropdown";
|
|
3
|
+
export { default as Breadcrumb } from "./Breadcrumb";
|
|
4
|
+
export { default as ResponsiveNavbar } from "./ResponsiveNavbar";
|
|
5
|
+
export { default as SideNavbar } from "./SideNavbar";
|
|
@@ -14,6 +14,17 @@ interface MultiPurposeModalProps {
|
|
|
14
14
|
disableScroll?: boolean;
|
|
15
15
|
handleSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
16
16
|
removeForm?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Controls whether the modal should force re-render when children change
|
|
19
|
+
* @default true
|
|
20
|
+
* Set to false when using forms or components that manage their own state
|
|
21
|
+
*/
|
|
22
|
+
enableContentRefresh?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Preserves scroll position when content refreshes (only works when enableContentRefresh is true)
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
preserveScrollPosition?: boolean;
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
19
30
|
* A multipurpose modal component for InstinctHub applications
|
|
@@ -21,20 +32,24 @@ interface MultiPurposeModalProps {
|
|
|
21
32
|
* @component
|
|
22
33
|
* @example
|
|
23
34
|
* ```tsx
|
|
35
|
+
* // For forms - disable content refresh to prevent scroll jumping
|
|
24
36
|
* <MultiPurposeModal
|
|
25
37
|
* isOpen={isOpen}
|
|
26
38
|
* onClose={onClose}
|
|
27
|
-
* title="
|
|
28
|
-
*
|
|
29
|
-
* showFooter={true}
|
|
30
|
-
* footerContent={<div>Some Footer Content</div>}
|
|
31
|
-
* showCloseButton={true}
|
|
32
|
-
* closeOnOverlayClick={true}
|
|
33
|
-
* className="ihub-modal-class"
|
|
34
|
-
* disableScroll={true}
|
|
35
|
-
* handleSubmit={handleSubmit}
|
|
39
|
+
* title="User Form"
|
|
40
|
+
* enableContentRefresh={false}
|
|
36
41
|
* >
|
|
37
|
-
* <
|
|
42
|
+
* <UserForm />
|
|
43
|
+
* </MultiPurposeModal>
|
|
44
|
+
*
|
|
45
|
+
* // For dynamic content - enable content refresh (default behavior)
|
|
46
|
+
* <MultiPurposeModal
|
|
47
|
+
* isOpen={isOpen}
|
|
48
|
+
* onClose={onClose}
|
|
49
|
+
* title="Dynamic Content"
|
|
50
|
+
* enableContentRefresh={true}
|
|
51
|
+
* >
|
|
52
|
+
* {dynamicContent}
|
|
38
53
|
* </MultiPurposeModal>
|
|
39
54
|
* ```
|
|
40
55
|
*
|
|
@@ -52,6 +67,8 @@ interface MultiPurposeModalProps {
|
|
|
52
67
|
* @param disableScroll Whether to disable body scrolling when modal is open
|
|
53
68
|
* @param handleSubmit Function to call when the modal is submitted
|
|
54
69
|
* @param removeForm Whether to remove the default form element
|
|
70
|
+
* @param enableContentRefresh Whether to force re-render when children change (default: true)
|
|
71
|
+
* @param preserveScrollPosition Whether to maintain scroll position during refreshes (default: true)
|
|
55
72
|
*/
|
|
56
73
|
declare const MultiPurposeModal: React.FC<MultiPurposeModalProps>;
|
|
57
74
|
export default MultiPurposeModal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as TimeTracker } from "./ReactTimeTracker";
|
|
2
|
+
export { default as SessionHandleProvider } from "./SessionHandleProvider";
|
|
3
|
+
export { default as Error500 } from "./Error500";
|
|
4
|
+
export { default as ErrorState } from "./ErrorState";
|
|
5
|
+
export { default as ReactTimeTracker } from "./ReactTimeTracker";
|
|
6
|
+
export { default as DeleteConfirmationModal } from "./DeleteConfirmationModal";
|
|
7
|
+
export { default as CopyToClipboard } from "./CopyToClipBoard";
|
|
8
|
+
export { default as MultiPurposeModal } from "./MultiPurposeModal";
|
|
9
|
+
export { default as ModalExamples } from "./ModalExamples";
|
|
10
|
+
export { default as NotFound } from "./NotFound";
|
|
11
|
+
export { default as Unauthorized } from "./Unauthorized";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ChangeStyleVariable } from "./ChangeStyleVariable";
|
|
2
|
+
export { default as DarkModeProvider } from "./DarkModeProvider";
|
|
3
|
+
export { default as LoadingAnimate } from "./LoadingAnimate";
|
|
4
|
+
export { default as SessionProviders } from "./SessionProviders";
|
|
5
|
+
export { default as SessionExpiresLogout } from "./signout/SessionExpiresLogout";
|
|
6
|
+
export { default as SignOutSession } from "./signout/SignOutSession";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface CreateButtonProps {
|
|
3
|
+
/** Text to display on the button */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Search parameter key-value to add to URL */
|
|
6
|
+
searchParam?: {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
/** Fallback function when no searchParam is provided */
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
/** Button variant style */
|
|
13
|
+
variant?: "primary" | "outlined" | "important" | "danger";
|
|
14
|
+
/** Whether the button is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Additional CSS classes */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Button size */
|
|
19
|
+
size?: "small" | "medium" | "large";
|
|
20
|
+
/** Show loading state */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Icon to display before text */
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/** Whether to show animation effects */
|
|
25
|
+
animated?: boolean;
|
|
26
|
+
/** Additional HTML button attributes */
|
|
27
|
+
buttonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Modern create button component with URL search parameter support
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <CreateButton
|
|
34
|
+
* label="Create Course"
|
|
35
|
+
* searchParam={{ key: "create", value: "course" }}
|
|
36
|
+
* variant="important"
|
|
37
|
+
* animated={true}
|
|
38
|
+
* />
|
|
39
|
+
* @param props - Component props
|
|
40
|
+
* @param props.label - Button text
|
|
41
|
+
* @param props.searchParam - Search parameter to add to URL
|
|
42
|
+
* @param props.onClick - Callback function for click events
|
|
43
|
+
* @param props.variant - Button variant style
|
|
44
|
+
* @param props.disabled - Disable the button
|
|
45
|
+
* @param props.className - Additional CSS class name
|
|
46
|
+
* @param props.size - Button size
|
|
47
|
+
* @param props.loading - Loading state
|
|
48
|
+
* @param props.icon - Icon to display before text
|
|
49
|
+
* @param props.animated - Animated button spinner
|
|
50
|
+
* @param props.buttonProps - Additional button props
|
|
51
|
+
* @returns JSX.Element
|
|
52
|
+
*/
|
|
53
|
+
declare const CreateButton: React.FC<CreateButtonProps>;
|
|
54
|
+
export default CreateButton;
|
|
@@ -2,14 +2,15 @@ interface TextEditorProps {
|
|
|
2
2
|
label?: string;
|
|
3
3
|
name?: string;
|
|
4
4
|
note?: string;
|
|
5
|
-
onChange
|
|
5
|
+
onChange?: (html: string) => void;
|
|
6
6
|
setIsEditing?: (html: boolean) => void;
|
|
7
7
|
isEditing?: boolean;
|
|
8
|
-
content
|
|
8
|
+
content?: string;
|
|
9
9
|
charLimit?: number;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
lastUpdated?: string;
|
|
12
12
|
showPreviewBtn?: boolean;
|
|
13
|
+
required?: boolean;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* CustomTextEditor is a component that allows you to create a text editor with a menu bar and a preview button.
|
|
@@ -34,8 +35,11 @@ interface TextEditorProps {
|
|
|
34
35
|
* @param {string} props.placeholder - The placeholder for the editor.
|
|
35
36
|
* @param {string} props.lastUpdated - The last updated date for the editor.
|
|
36
37
|
* @param {boolean} props.showPreviewBtn - Whether to show the preview button.
|
|
38
|
+
* @param {string} props.note - The note to display below the editor.
|
|
39
|
+
* @param {function} props.setIsEditing - Function to set the editing state.
|
|
40
|
+
* @param {boolean} props.required - Whether the editor is required.
|
|
37
41
|
* @returns {React.ReactNode} The CustomTextEditor component.
|
|
38
42
|
*
|
|
39
43
|
*/
|
|
40
|
-
export default function CustomTextEditor({ label, name, note, onChange, setIsEditing, content, isEditing, charLimit, placeholder, lastUpdated, showPreviewBtn, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export default function CustomTextEditor({ label, name, note, onChange, setIsEditing, content, isEditing, charLimit, placeholder, lastUpdated, showPreviewBtn, required, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
41
45
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as CustomTextEditor } from "./editor/CustomTextEditor";
|
|
2
|
+
export { default as ContentViewer } from "./viewer/ContentViewer";
|
|
3
|
+
export { default as ContentViewOrEdit } from "./viewer/ContentViewOrEdit";
|
|
4
|
+
export { default as CodeDisplay } from "./viewer/CodeDisplay";
|
|
5
|
+
export { default as IHubTable } from "./tables/IHubTable";
|
|
6
|
+
export { default as IHubTableServer } from "./tables/IHubTableServer";
|
|
7
|
+
export { default as OrDivider } from "./OrDivider";
|
|
8
|
+
export { default as RandomGradientImage } from "./images/RandomGradientImage";
|
|
9
|
+
export { default as Dialog } from "./dialogs/Dialog";
|
|
10
|
+
export { default as Badge } from "./Badge";
|
|
11
|
+
export { default as Action } from "./Action";
|
|
12
|
+
export { default as Dropdown } from "./Dropdown";
|
|
13
|
+
export { default as ColorPicker } from "./ColorPicker";
|
|
14
|
+
export { default as ComponentLists } from "./ComponentLists";
|
|
15
|
+
export * from "./cards";
|
|
16
|
+
export * from "./charts";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PaginationPropsType } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Enhanced Pagination Component with API Integration
|
|
5
|
+
* Handles pagination, search, and filtering with automatic API calls
|
|
6
|
+
*/
|
|
7
|
+
declare const Pagination: React.FC<PaginationPropsType>;
|
|
8
|
+
export default Pagination;
|
|
@@ -44,12 +44,14 @@ export { default as InputText } from "./components/forms/InputText";
|
|
|
44
44
|
export { default as InputTextarea } from "./components/forms/InputTextarea";
|
|
45
45
|
export { default as SearchObjectsFromDB } from "./components/forms/SearchObjectsFromDB";
|
|
46
46
|
export { default as ToggleButton } from "./components/forms/ToggleButton";
|
|
47
|
-
export { default as
|
|
47
|
+
export { default as CheckBoxesField } from "./components/forms/CheckboxesField";
|
|
48
|
+
export { default as CheckBoxes } from "./components/forms/CheckBoxes";
|
|
48
49
|
export { default as DateInputPicker } from "./components/forms/DateInputPicker";
|
|
49
50
|
export { default as ChipsInput } from "./components/forms/ChipsInput";
|
|
50
51
|
export { default as RadioButton } from "./components/forms/radio-btn/RadioButton";
|
|
51
52
|
export { default as RadioGroup } from "./components/forms/radio-btn/RadioGroup";
|
|
52
53
|
export { default as InputAmount } from "./components/forms/InputAmount";
|
|
54
|
+
export { default as FileField } from "./components/forms/FileField";
|
|
53
55
|
export { default as ChannelListAvatar } from "./components/navbar/ChannelListAvatar";
|
|
54
56
|
export { default as MenuDropdown } from "./components/navbar/MenuDropdown";
|
|
55
57
|
export { default as Breadcrumb } from "./components/navbar/Breadcrumb";
|
|
@@ -65,11 +67,16 @@ export { default as IHubTable } from "./components/ui/tables/IHubTable";
|
|
|
65
67
|
export { default as IHubTableServer } from "./components/ui/tables/IHubTableServer";
|
|
66
68
|
export { default as OrDivider } from "./components/ui/OrDivider";
|
|
67
69
|
export { default as RandomGradientImage } from "./components/ui/images/RandomGradientImage";
|
|
70
|
+
export { default as ComponentLists } from "./components/ui/ComponentLists";
|
|
71
|
+
export { default as Action } from "./components/ui/Action";
|
|
68
72
|
export { default as Dialog } from "./components/ui/dialogs/Dialog";
|
|
69
73
|
export { default as Badge } from "./components/ui/Badge";
|
|
70
|
-
export { default as Action } from "./components/ui/Action";
|
|
71
74
|
export { default as Dropdown } from "./components/ui/Dropdown";
|
|
72
75
|
export { default as ColorPicker } from "./components/ui/ColorPicker";
|
|
76
|
+
export { default as Pagination } from "./components/ui/pagination/Pagination";
|
|
77
|
+
export { default as PaginationDemo } from "./components/ui/pagination/PaginationDemo";
|
|
78
|
+
export { default as CreateButton } from "./components/ui/create-button/CreateButton";
|
|
79
|
+
export { default as CreateButtonExample } from "./components/ui/create-button/CreateButtonExample";
|
|
73
80
|
export * from "./components/ui/cards";
|
|
74
81
|
export * from "./components/ui/charts";
|
|
75
82
|
export { default as ChangeStyleVariable } from "./components/theme/ChangeStyleVariable";
|
|
@@ -92,4 +99,3 @@ export { default as Unauthorized } from "./components/status/Unauthorized";
|
|
|
92
99
|
export { default as Tabs } from "./components/tabs/Tabs";
|
|
93
100
|
export { default as VerticalTabs } from "./components/tabs/VerticalTabs";
|
|
94
101
|
export { default as TabContent } from "./components/tabs/TabContent";
|
|
95
|
-
export { default as ComponentLists } from "./components/ComponentLists";
|
|
@@ -247,6 +247,8 @@ export interface LoginFormPropsType {
|
|
|
247
247
|
endpointPath?: string;
|
|
248
248
|
verificationPath?: string;
|
|
249
249
|
redirectPath?: string;
|
|
250
|
+
hideResetPassword?: boolean;
|
|
251
|
+
hideSignup?: boolean;
|
|
250
252
|
type?: string | "sis" | "skills" | "lms" | "crm" | "ecommerce" | "inventory" | "hr";
|
|
251
253
|
}
|
|
252
254
|
export interface DropdownOptionType {
|
|
@@ -348,16 +350,16 @@ export interface PaystackConfigObjectType {
|
|
|
348
350
|
metadata?: PaystackMetadataType;
|
|
349
351
|
}
|
|
350
352
|
export interface PaystackConfigType {
|
|
351
|
-
authorization_code?: string;
|
|
352
|
-
reference: string;
|
|
353
353
|
email: string;
|
|
354
354
|
first_name: string;
|
|
355
355
|
last_name: string;
|
|
356
356
|
currency: string;
|
|
357
357
|
amount: number;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
reference?: string;
|
|
359
|
+
authorization_code?: string;
|
|
360
|
+
publicKey?: string | undefined;
|
|
361
|
+
key?: string | undefined;
|
|
362
|
+
callback_url?: string;
|
|
361
363
|
metadata?: PaystackMetadataType;
|
|
362
364
|
}
|
|
363
365
|
export interface PaystackResponseType {
|
|
@@ -419,3 +421,38 @@ export interface PaymentReferenceType {
|
|
|
419
421
|
redirecturl?: string;
|
|
420
422
|
[key: string]: any;
|
|
421
423
|
}
|
|
424
|
+
export interface PaginationData {
|
|
425
|
+
count: number;
|
|
426
|
+
next: string | null;
|
|
427
|
+
previous: string | null;
|
|
428
|
+
results: any[];
|
|
429
|
+
}
|
|
430
|
+
export interface PaginationPropsType {
|
|
431
|
+
/** Current offset value from URL params */
|
|
432
|
+
offset: string | number;
|
|
433
|
+
/** Pagination data from API response */
|
|
434
|
+
data: PaginationData;
|
|
435
|
+
/** Number of items per page */
|
|
436
|
+
limit: number;
|
|
437
|
+
/** API endpoint path */
|
|
438
|
+
urlPath: string;
|
|
439
|
+
/** Function to update data state */
|
|
440
|
+
setData: React.Dispatch<React.SetStateAction<any>>;
|
|
441
|
+
/** Authentication token */
|
|
442
|
+
token?: string | null;
|
|
443
|
+
/** Current tab filter value */
|
|
444
|
+
tabsValues?: string;
|
|
445
|
+
/** Current search query */
|
|
446
|
+
searchValues?: string;
|
|
447
|
+
/** Maximum number of page buttons to show */
|
|
448
|
+
rangeLimit?: number;
|
|
449
|
+
/** Additional CSS classes */
|
|
450
|
+
className?: string;
|
|
451
|
+
/** Whether to show first/last buttons */
|
|
452
|
+
showFirstLast?: boolean;
|
|
453
|
+
}
|
|
454
|
+
export interface QueryContextType {
|
|
455
|
+
key: string;
|
|
456
|
+
value?: string | number | boolean | null;
|
|
457
|
+
action: "add" | "update" | "remove" | "toggle" | "clear";
|
|
458
|
+
}
|