@barabel324/popups-engine 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.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Popups-engine
@@ -0,0 +1 @@
1
+ ._parent_wmksm_1{z-index:100;position:fixed;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100vh;background-color:#00000080}._parent_1ud1o_1{color:#fff}
@@ -0,0 +1,68 @@
1
+ import { Variant } from 'motion/react';
2
+
3
+ declare type FCClass<P = object> = React.FC<P & React.PropsWithChildren & {
4
+ className?: string;
5
+ }>;
6
+
7
+ export declare const PopupEngineProvider: FCClass<TPEProvider>;
8
+
9
+ export declare const PopupEngineRoot: FCClass<TPERoot>;
10
+
11
+ declare type TPEClassNames = {
12
+ [K in keyof TPEMapComponents]?: TPEMapComponents[K]['className'];
13
+ };
14
+
15
+ declare type TPEComponents = {
16
+ [K in keyof TPEMapComponents]?: TPEMapComponents[K]['component'];
17
+ };
18
+
19
+ declare type TPEContext = {
20
+ openPopup: (data: TPEExecute) => void;
21
+ closePopup: () => void;
22
+ closeFirstPopup: () => void;
23
+ closeAllPopups: () => void;
24
+ };
25
+
26
+ declare type TPEExecute = {
27
+ variant: string;
28
+ popupProps?: Record<string, any>;
29
+ isCloseAll?: boolean;
30
+ components?: TPEComponents;
31
+ classNames?: TPEClassNames;
32
+ motionVariants?: TPEMotionVariants;
33
+ };
34
+
35
+ declare type TPEMapComponents = {
36
+ wrapper: {
37
+ component: TPEWrapper;
38
+ className: string;
39
+ };
40
+ loader: {
41
+ component: FCClass;
42
+ className: string;
43
+ };
44
+ };
45
+
46
+ declare type TPEMotionVariants = {
47
+ initial: Variant;
48
+ animate: Variant;
49
+ exit: Variant;
50
+ };
51
+
52
+ declare type TPEProvider = {
53
+ popups: Record<string, FCClass<any>>;
54
+ };
55
+
56
+ declare type TPERoot = {
57
+ id?: string;
58
+ enableBodyScroll?: () => void;
59
+ lockBodyScroll?: () => void;
60
+ };
61
+
62
+ declare type TPEWrapper = FCClass<{
63
+ motionVariants?: TPEMotionVariants;
64
+ }>;
65
+
66
+ export declare const usePopupEngineProvider: () => TPEContext;
67
+
68
+ export { }