aark-react-modalify 1.2.2 → 1.3.0
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/aark-react-modalify.css +1 -1
- package/dist/index-no-styles.cjs.js +14 -1
- package/dist/index-no-styles.d.mts +189 -0
- package/dist/index-no-styles.d.ts +189 -0
- package/dist/index-no-styles.esm.js +14 -14
- package/dist/index.cjs.js +14 -51
- package/dist/index.d.mts +189 -0
- package/dist/index.d.ts +189 -9
- package/dist/index.esm.js +14 -62
- package/package.json +86 -92
- package/dist/components/Icon.d.ts +0 -18
- package/dist/components/Modal.d.ts +0 -9
- package/dist/components/ModalProvider.d.ts +0 -7
- package/dist/components/Notification.d.ts +0 -9
- package/dist/components/modals/StandardModal.d.ts +0 -8
- package/dist/components/modals/index.d.ts +0 -1
- package/dist/components/notifications/StandardNotification.d.ts +0 -8
- package/dist/components/notifications/index.d.ts +0 -1
- package/dist/hooks/useModal.d.ts +0 -10
- package/dist/logic/ModalManager.d.ts +0 -24
- package/dist/logic/ModalManagerNew.d.ts +0 -0
- package/dist/logic/aark.d.ts +0 -15
- package/dist/types/index.d.ts +0 -102
- package/dist/utils/inject-styles.d.ts +0 -4
- package/dist/utils/modal-css.d.ts +0 -1
- package/dist/utils/modal-root.d.ts +0 -18
- package/dist/utils/theme.d.ts +0 -40
- package/dist/vite.svg +0 -1
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { ComponentConfig, ModalOptions, NotificationOptions, ModalEvent, ModalProps, NotificationProps } from "../types";
|
|
3
|
-
type ModalListener = (event: ModalEvent) => void;
|
|
4
|
-
declare function subscribe(listener: ModalListener): () => void;
|
|
5
|
-
declare function fireModal(contentOrProps: ReactNode | ModalProps, options?: ModalOptions): void;
|
|
6
|
-
declare function fireNotification(contentOrProps: ReactNode | NotificationProps, options?: NotificationOptions): void;
|
|
7
|
-
declare function fire(contentOrProps: ReactNode | ModalProps, options?: ModalOptions): void;
|
|
8
|
-
declare function close(): void;
|
|
9
|
-
declare function isOpen(): boolean;
|
|
10
|
-
declare function getCurrentConfig(): ComponentConfig | null;
|
|
11
|
-
declare function closeAll(): void;
|
|
12
|
-
declare function cleanup(): void;
|
|
13
|
-
export declare const modalManager: {
|
|
14
|
-
subscribe: typeof subscribe;
|
|
15
|
-
fire: typeof fire;
|
|
16
|
-
fireModal: typeof fireModal;
|
|
17
|
-
fireNotification: typeof fireNotification;
|
|
18
|
-
close: typeof close;
|
|
19
|
-
isOpen: typeof isOpen;
|
|
20
|
-
getCurrentConfig: typeof getCurrentConfig;
|
|
21
|
-
closeAll: typeof closeAll;
|
|
22
|
-
cleanup: typeof cleanup;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
File without changes
|
package/dist/logic/aark.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { ModalOptions, NotificationOptions, ModalProps, NotificationProps } from "../types";
|
|
3
|
-
import type { AarkModalTheme } from "../utils/theme";
|
|
4
|
-
declare const aark: {
|
|
5
|
-
fire: (contentOrProps: ReactNode | ModalProps, options?: ModalOptions) => void;
|
|
6
|
-
modal: (contentOrProps: ReactNode | ModalProps, options?: ModalOptions) => void;
|
|
7
|
-
notification: (contentOrProps: ReactNode | NotificationProps, options?: NotificationOptions) => void;
|
|
8
|
-
close: () => void;
|
|
9
|
-
isOpen: () => boolean;
|
|
10
|
-
closeAll: () => void;
|
|
11
|
-
setTheme: (theme: AarkModalTheme) => void;
|
|
12
|
-
resetTheme: () => void;
|
|
13
|
-
getTheme: () => AarkModalTheme;
|
|
14
|
-
};
|
|
15
|
-
export default aark;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type ModalPosition = "center" | "top-center" | "top-right" | "bottom-right" | "bottom-center";
|
|
3
|
-
export type NotificationPosition = "top-right" | "top-center" | "top-left" | "bottom-right" | "bottom-center" | "bottom-left";
|
|
4
|
-
export type ModalMode = "modal" | "notification";
|
|
5
|
-
export type ModalType = "success" | "error" | "warning" | "info" | "question";
|
|
6
|
-
export interface ModalProps {
|
|
7
|
-
title?: string;
|
|
8
|
-
text?: string;
|
|
9
|
-
type?: ModalType;
|
|
10
|
-
cancelText?: string;
|
|
11
|
-
confirmText?: string;
|
|
12
|
-
onCancel?: () => void;
|
|
13
|
-
onConfirm?: () => void;
|
|
14
|
-
icon?: string | ReactNode;
|
|
15
|
-
html?: string | ReactNode;
|
|
16
|
-
showCancelButton?: boolean;
|
|
17
|
-
showConfirmButton?: boolean;
|
|
18
|
-
allowOutsideClick?: boolean;
|
|
19
|
-
allowEscapeKey?: boolean;
|
|
20
|
-
reverseButtons?: boolean;
|
|
21
|
-
focusConfirm?: boolean;
|
|
22
|
-
focusCancel?: boolean;
|
|
23
|
-
width?: string | number;
|
|
24
|
-
fullWidth?: boolean;
|
|
25
|
-
padding?: string | number;
|
|
26
|
-
background?: string;
|
|
27
|
-
customClass?: {
|
|
28
|
-
container?: string;
|
|
29
|
-
popup?: string;
|
|
30
|
-
header?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
closeButton?: string;
|
|
33
|
-
icon?: string;
|
|
34
|
-
image?: string;
|
|
35
|
-
content?: string;
|
|
36
|
-
input?: string;
|
|
37
|
-
actions?: string;
|
|
38
|
-
confirmButton?: string;
|
|
39
|
-
cancelButton?: string;
|
|
40
|
-
footer?: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export interface NotificationProps {
|
|
44
|
-
title?: string;
|
|
45
|
-
text?: string;
|
|
46
|
-
type?: ModalType;
|
|
47
|
-
icon?: string | ReactNode;
|
|
48
|
-
html?: string | ReactNode;
|
|
49
|
-
timer?: number;
|
|
50
|
-
showCloseButton?: boolean;
|
|
51
|
-
clickToClose?: boolean;
|
|
52
|
-
width?: string | number;
|
|
53
|
-
fullWidth?: boolean;
|
|
54
|
-
padding?: string | number;
|
|
55
|
-
background?: string;
|
|
56
|
-
customClass?: {
|
|
57
|
-
container?: string;
|
|
58
|
-
popup?: string;
|
|
59
|
-
header?: string;
|
|
60
|
-
title?: string;
|
|
61
|
-
closeButton?: string;
|
|
62
|
-
icon?: string;
|
|
63
|
-
content?: string;
|
|
64
|
-
footer?: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export interface BaseOptions {
|
|
68
|
-
showCloseIcon?: boolean;
|
|
69
|
-
className?: string;
|
|
70
|
-
preventEscClose?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export interface ModalOptions extends BaseOptions {
|
|
73
|
-
position?: ModalPosition;
|
|
74
|
-
overlayClassName?: string;
|
|
75
|
-
preventOverlayClose?: boolean;
|
|
76
|
-
}
|
|
77
|
-
export interface NotificationOptions extends BaseOptions {
|
|
78
|
-
position?: NotificationPosition;
|
|
79
|
-
autoCloseTime?: number;
|
|
80
|
-
}
|
|
81
|
-
export interface ModalConfig {
|
|
82
|
-
content?: ReactNode;
|
|
83
|
-
props?: ModalProps;
|
|
84
|
-
options?: ModalOptions;
|
|
85
|
-
mode: "modal";
|
|
86
|
-
}
|
|
87
|
-
export interface NotificationConfig {
|
|
88
|
-
content?: ReactNode;
|
|
89
|
-
props?: NotificationProps;
|
|
90
|
-
options?: NotificationOptions;
|
|
91
|
-
mode: "notification";
|
|
92
|
-
}
|
|
93
|
-
export type ComponentConfig = ModalConfig | NotificationConfig;
|
|
94
|
-
export interface ModalState {
|
|
95
|
-
isOpen: boolean;
|
|
96
|
-
config: ComponentConfig | null;
|
|
97
|
-
}
|
|
98
|
-
export type ModalEventType = "open" | "close" | "beforeClose";
|
|
99
|
-
export interface ModalEvent {
|
|
100
|
-
type: ModalEventType;
|
|
101
|
-
config?: ComponentConfig;
|
|
102
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MODAL_CSS = ":root{--aark-modal-overlay-bg:rgba(0,0,0,.5);--aark-modal-bg:#fff;--aark-modal-radius:8px;--aark-modal-shadow:0 10px 25px rgba(0,0,0,.15);--aark-modal-pad:16px;--aark-modal-z:9999;--aark-close-color:#666;--aark-close-hover:#f5f5f5;--aark-anim:.2s}.aark-modal-content{position:fixed;background:var(--aark-modal-bg);border-radius:var(--aark-modal-radius);box-shadow:var(--aark-modal-shadow);padding:var(--aark-modal-pad);z-index:calc(var(--aark-modal-z) + 1);max-width:90vw;min-width:280px;max-height:90vh;overflow:auto}.aark-modal-content.notification{pointer-events:auto;background:var(--aark-modal-bg);box-shadow:var(--aark-modal-shadow);padding:var(--aark-modal-pad);width:auto;max-width:400px;min-width:280px;border-radius:var(--aark-modal-radius)}.aark-modal-content.center{top:50%;left:50%;transform:translate(-50%,-50%);animation:scale-in var(--aark-anim)}.aark-modal-content.top-center{top:20px;left:50%;transform:translateX(-50%);animation:slide-down var(--aark-anim)}.aark-modal-content.top-right{top:20px;right:20px;animation:slide-left var(--aark-anim)}.aark-modal-content.top-left{top:20px;left:20px;animation:slide-right var(--aark-anim)}.aark-modal-content.bottom-right{bottom:20px;right:20px;animation:slide-left var(--aark-anim)}.aark-modal-content.bottom-left{bottom:20px;left:20px;animation:slide-right var(--aark-anim)}.aark-modal-content.bottom-center{bottom:20px;left:50%;transform:translateX(-50%);animation:slide-up var(--aark-anim)}.aark-modal-close{position:absolute;top:8px;right:8px;width:30px;height:30px;padding:.5rem;display:flex;align-items:center;justify-content:center;background:0;border:0;color:var(--aark-close-color);cursor:pointer;border-radius:50%;font-size:14px;line-height:1;transition:all var(--aark-anim)}.aark-modal-close:hover{background:var(--aark-close-hover);color:#333}.aark-modal-close:focus{outline:2px solid #007bff;outline-offset:2px}.aark-modal-body{padding-top:8px}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes scale-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes slide-down{0%{opacity:0;transform:translateX(-50%) translateY(-20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}@keyframes slide-up{0%{opacity:0;transform:translateX(-50%) translateY(20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}@keyframes slide-left{0%{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-right{0%{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}@media (max-width:768px){.aark-modal-content{margin:10px;max-width:calc(100vw - 20px);min-width:auto}.aark-modal-content.center{top:50%;left:50%;transform:translate(-50%,-50%)}.aark-modal-content.top-center,.aark-modal-content.bottom-center{left:50%;transform:translateX(-50%)}.aark-modal-content.top-right{right:10px;left:auto;transform:none}.aark-modal-content.top-left{left:10px;right:auto;transform:none}.aark-modal-content.bottom-right{right:10px;bottom:10px;left:auto;transform:none}.aark-modal-content.bottom-left{left:10px;bottom:10px;right:auto;transform:none}.aark-modal-content.notification{width:auto;max-width:calc(100vw - 20px);min-width:auto}}@media (max-width:480px){.aark-modal-content{max-width:calc(100vw - 10px);margin:5px}.aark-modal-content.center{top:10px;left:50%;transform:translateX(-50%);max-height:calc(100vh - 20px)}}";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility to manage the single modal root container
|
|
3
|
-
* Ensures only one instance of aark-react-modalify-root exists
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Gets or creates the modal root container
|
|
7
|
-
* Returns the same instance for both modals and notifications
|
|
8
|
-
*/
|
|
9
|
-
export declare const getModalRoot: () => HTMLElement;
|
|
10
|
-
/**
|
|
11
|
-
* Cleanup function to remove the modal root when no longer needed
|
|
12
|
-
* Should be called when the last modal/notification is closed
|
|
13
|
-
*/
|
|
14
|
-
export declare const cleanupModalRoot: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Check if modal root exists and has content
|
|
17
|
-
*/
|
|
18
|
-
export declare const hasActiveModals: () => boolean;
|
package/dist/utils/theme.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CSS Theme customization utilities for AARK React Modalify
|
|
3
|
-
*/
|
|
4
|
-
export interface AarkModalTheme {
|
|
5
|
-
overlayBackground?: string;
|
|
6
|
-
overlayBlur?: string;
|
|
7
|
-
modalBackground?: string;
|
|
8
|
-
modalBorderRadius?: string;
|
|
9
|
-
modalShadow?: string;
|
|
10
|
-
modalPadding?: string;
|
|
11
|
-
modalZIndex?: number;
|
|
12
|
-
modalContentZIndex?: number;
|
|
13
|
-
closeButtonColor?: string;
|
|
14
|
-
closeButtonHoverBackground?: string;
|
|
15
|
-
closeButtonHoverColor?: string;
|
|
16
|
-
closeButtonFocusOutline?: string;
|
|
17
|
-
animationDuration?: string;
|
|
18
|
-
fadeDuration?: string;
|
|
19
|
-
customOverlayBackground?: string;
|
|
20
|
-
customOverlayBlur?: string;
|
|
21
|
-
customModalGradientStart?: string;
|
|
22
|
-
customModalGradientEnd?: string;
|
|
23
|
-
customModalTextColor?: string;
|
|
24
|
-
customModalShadow?: string;
|
|
25
|
-
customModalCloseColor?: string;
|
|
26
|
-
customModalCloseHoverBackground?: string;
|
|
27
|
-
customModalCloseHoverColor?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Apply custom theme to AARK Modal CSS variables
|
|
31
|
-
*/
|
|
32
|
-
export declare function setAarkModalTheme(theme: AarkModalTheme): void;
|
|
33
|
-
/**
|
|
34
|
-
* Reset AARK Modal theme to default values
|
|
35
|
-
*/
|
|
36
|
-
export declare function resetAarkModalTheme(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Get current AARK Modal theme values
|
|
39
|
-
*/
|
|
40
|
-
export declare function getAarkModalTheme(): AarkModalTheme;
|
package/dist/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|