@inntechcorp/it-design 3.1.13 → 3.1.14
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/dist/alink/index.d.ts +10 -2
- package/dist/index.cjs.js +225 -225
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +43 -22
- package/dist/index.esm.js +223 -223
- package/dist/locales/calendar.json +22 -22
- package/dist/locales/itd.json +235 -234
- package/dist/modal/context/ModalContext.d.ts +11 -20
- package/dist/modal/index.d.ts +22 -7
- package/package.json +1 -1
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { ModalState } from "enums/enum";
|
|
2
2
|
import { ModalProps } from "types/ModalProps";
|
|
3
|
-
export type
|
|
3
|
+
export type ModalActionsContextType = {
|
|
4
4
|
/**
|
|
5
5
|
* Opens a new modal with the provided information of the modal to be opened.
|
|
6
|
-
*
|
|
7
6
|
* @param data Contains the desired parameters for opening a new modal `ModalProps`.
|
|
8
|
-
* @returns
|
|
9
7
|
*/
|
|
10
8
|
showModal: (data: ModalProps) => void;
|
|
11
9
|
/**
|
|
12
10
|
* Dismisses the currently open modal with the ID of the modal to be hidden.
|
|
13
|
-
*
|
|
14
11
|
* @param id ID of the modal to be hide.
|
|
15
|
-
* @returns
|
|
16
12
|
*/
|
|
17
13
|
hideModal: (id: string) => void;
|
|
18
14
|
/**
|
|
19
15
|
* Dismisses the currently open modal with the ID of the modal to be closed.
|
|
20
|
-
*
|
|
21
16
|
* @param id ID of the modal to be dismissed.
|
|
22
|
-
* @returns
|
|
23
17
|
*/
|
|
24
18
|
removeModal: (id: string) => void;
|
|
25
19
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @returns
|
|
20
|
+
* Removes all open modals.
|
|
28
21
|
*/
|
|
29
22
|
removeAllModals: () => void;
|
|
23
|
+
};
|
|
24
|
+
export type ModalStateContextType = {
|
|
30
25
|
/**
|
|
31
26
|
* Triggered whenever any event related to modals occurs.
|
|
32
27
|
*/
|
|
@@ -36,42 +31,38 @@ export type ModalContextType = {
|
|
|
36
31
|
};
|
|
37
32
|
/**
|
|
38
33
|
* Returns whether a modal is visible or not.
|
|
39
|
-
*
|
|
40
34
|
* @param id The visibility information of the desired modal with its ID.
|
|
41
|
-
* @returns
|
|
42
35
|
*/
|
|
43
36
|
isVisible: (id: string) => boolean;
|
|
44
37
|
};
|
|
38
|
+
export type ModalContextType = ModalActionsContextType & ModalStateContextType;
|
|
45
39
|
export type ModalContainerProps = {
|
|
46
40
|
/**
|
|
47
41
|
* Called when another modal is requested to be shown from within a modal.
|
|
48
|
-
*
|
|
49
42
|
* @param data Contains the desired parameters for opening a new modal `ModalProps`.
|
|
50
|
-
* @returns
|
|
51
43
|
*/
|
|
52
44
|
onShowModal: (data: ModalProps) => void;
|
|
53
45
|
/**
|
|
54
46
|
* Called when it's requested to hide an open modal.
|
|
55
|
-
*
|
|
56
47
|
* @param id ID of the modal to be hide.
|
|
57
|
-
* @returns
|
|
58
48
|
*/
|
|
59
49
|
onHideModal: (id: string) => void;
|
|
60
50
|
/**
|
|
61
51
|
* Called when it's requested to dismiss an open modal.
|
|
62
|
-
*
|
|
63
52
|
* @param id ID of the modal to be dismissed.
|
|
64
|
-
* @returns
|
|
65
53
|
*/
|
|
66
54
|
onRemoveModal: (id: string) => void;
|
|
67
55
|
/**
|
|
68
56
|
* Called on any event related to modals.
|
|
69
|
-
*
|
|
70
57
|
* @param event The modal event that occurred.
|
|
71
|
-
* @param id
|
|
72
|
-
* @returns
|
|
58
|
+
* @param id The ID of the modal.
|
|
73
59
|
*/
|
|
74
60
|
onModalEvent: (event: ModalState, id: string) => void;
|
|
75
61
|
};
|
|
62
|
+
/** Actions context - stable, never causes rerenders */
|
|
63
|
+
declare const ModalActionsContext: import("react").Context<ModalActionsContextType>;
|
|
64
|
+
/** State context - dynamic, only subscribe if needed */
|
|
65
|
+
declare const ModalStateContext: import("react").Context<ModalStateContextType>;
|
|
76
66
|
declare const ModalContext: import("react").Context<ModalContextType>;
|
|
67
|
+
export { ModalActionsContext, ModalStateContext };
|
|
77
68
|
export default ModalContext;
|
package/dist/modal/index.d.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { ModalContextType } from "./context/ModalContext";
|
|
1
|
+
import { ModalActionsContextType, ModalStateContextType, ModalContextType } from "./context/ModalContext";
|
|
2
2
|
export declare const ModalProvider: ({ children }: {
|
|
3
|
-
children:
|
|
3
|
+
children: React.ReactNode;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
/**
|
|
6
|
-
* Use
|
|
7
|
-
*
|
|
6
|
+
* Use modal actions only (stable - won't cause rerenders on modal state changes)
|
|
7
|
+
* This is the recommended hook for most use cases.
|
|
8
|
+
* @returns showModal, hideModal, removeModal, removeAllModals
|
|
8
9
|
*/
|
|
9
|
-
declare const useModal: () =>
|
|
10
|
+
declare const useModal: () => ModalActionsContextType;
|
|
11
|
+
/**
|
|
12
|
+
* Use modal state (dynamic - will rerender on modal events)
|
|
13
|
+
* Only use this if you need to react to modal state changes.
|
|
14
|
+
* @returns modalEvent, isVisible
|
|
15
|
+
*/
|
|
16
|
+
declare const useModalState: () => ModalStateContextType;
|
|
17
|
+
/**
|
|
18
|
+
* Use both modal actions and state (legacy - will rerender on modal events)
|
|
19
|
+
* @deprecated Use useModal() for actions and useModalState() for state separately
|
|
20
|
+
* @returns All modal context values
|
|
21
|
+
*/
|
|
22
|
+
declare const useModalFull: () => ModalContextType;
|
|
10
23
|
declare const ModalManager: {
|
|
11
|
-
useModal: () =>
|
|
24
|
+
useModal: () => ModalActionsContextType;
|
|
25
|
+
useModalState: () => ModalStateContextType;
|
|
26
|
+
useModalFull: () => ModalContextType;
|
|
12
27
|
};
|
|
13
|
-
export { useModal };
|
|
28
|
+
export { useModal, useModalState, useModalFull };
|
|
14
29
|
export default ModalManager;
|