@lerx/promise-modal 0.2.7 → 0.2.8
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/index.d.ts +1 -1
- package/dist/providers/ConfigurationContext/ConfigurationContext.d.ts +2 -8
- package/dist/providers/ConfigurationContext/ConfigurationContextProvider.d.ts +2 -12
- package/dist/providers/ConfigurationContext/useConfigurationContext.d.ts +1 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/option.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export { useDestroyAfter } from './hooks/useDestroyAfter';
|
|
|
5
5
|
export { useActiveModalCount } from './hooks/useActiveModalCount';
|
|
6
6
|
export { useModalAnimation } from './hooks/useModalAnimation';
|
|
7
7
|
export { alert, confirm, prompt } from './core';
|
|
8
|
-
export type { ModalFrameProps, FooterComponentProps, ModalBackground, PromptInputProps, AlertContentProps, ConfirmContentProps, PromptContentProps, WrapperComponentProps, } from './types';
|
|
8
|
+
export type { ModalOptions, ModalFrameProps, FooterComponentProps, ModalBackground, PromptInputProps, AlertContentProps, ConfirmContentProps, PromptContentProps, WrapperComponentProps, } from './types';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { BackgroundComponent, FooterComponentProps, ForegroundComponent, WrapperComponentProps } from '../../types';
|
|
2
|
+
import type { BackgroundComponent, FooterComponentProps, ForegroundComponent, ModalOptions, WrapperComponentProps } from '../../types';
|
|
4
3
|
export interface ConfigurationContextProps {
|
|
5
4
|
ForegroundComponent: ForegroundComponent;
|
|
6
5
|
BackgroundComponent?: BackgroundComponent;
|
|
@@ -8,11 +7,6 @@ export interface ConfigurationContextProps {
|
|
|
8
7
|
SubtitleComponent: ComponentType<WrapperComponentProps>;
|
|
9
8
|
ContentComponent: ComponentType<WrapperComponentProps>;
|
|
10
9
|
FooterComponent: ComponentType<FooterComponentProps>;
|
|
11
|
-
options:
|
|
12
|
-
duration: Duration;
|
|
13
|
-
backdrop: Color;
|
|
14
|
-
manualDestroy: boolean;
|
|
15
|
-
closeOnBackdropClick: boolean;
|
|
16
|
-
};
|
|
10
|
+
options: Required<ModalOptions>;
|
|
17
11
|
}
|
|
18
12
|
export declare const ConfigurationContext: import("react").Context<ConfigurationContextProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type PropsWithChildren } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { FooterComponentProps, ModalFrameProps, WrapperComponentProps } from '../../types';
|
|
2
|
+
import type { FooterComponentProps, ModalFrameProps, ModalOptions, WrapperComponentProps } from '../../types';
|
|
4
3
|
export interface ConfigurationContextProviderProps {
|
|
5
4
|
BackgroundComponent?: ComponentType<ModalFrameProps>;
|
|
6
5
|
ForegroundComponent?: ComponentType<ModalFrameProps>;
|
|
@@ -8,15 +7,6 @@ export interface ConfigurationContextProviderProps {
|
|
|
8
7
|
SubtitleComponent?: ComponentType<WrapperComponentProps>;
|
|
9
8
|
ContentComponent?: ComponentType<WrapperComponentProps>;
|
|
10
9
|
FooterComponent?: ComponentType<FooterComponentProps>;
|
|
11
|
-
options?:
|
|
12
|
-
/** Modal transition time(ms, s) */
|
|
13
|
-
duration?: Duration;
|
|
14
|
-
/** Modal backdrop color */
|
|
15
|
-
backdrop?: Color;
|
|
16
|
-
/** Whether to destroy the modal manually */
|
|
17
|
-
manualDestroy?: boolean;
|
|
18
|
-
/** Whether to close the modal when the backdrop is clicked */
|
|
19
|
-
closeOnBackdropClick?: boolean;
|
|
20
|
-
};
|
|
10
|
+
options?: ModalOptions;
|
|
21
11
|
}
|
|
22
12
|
export declare const ConfigurationContextProvider: import("react").MemoExoticComponent<({ ForegroundComponent, BackgroundComponent, TitleComponent, SubtitleComponent, ContentComponent, FooterComponent, options: inputOptions, children, }: PropsWithChildren<ConfigurationContextProviderProps>) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export declare const useConfigurationContext: () => import("./ConfigurationContext").ConfigurationContextProps;
|
|
2
|
-
export declare const useConfigurationOptions: () =>
|
|
3
|
-
duration: import("../../@aileron/declare").Duration;
|
|
4
|
-
backdrop: import("../../@aileron/declare").Color;
|
|
5
|
-
manualDestroy: boolean;
|
|
6
|
-
closeOnBackdropClick: boolean;
|
|
7
|
-
};
|
|
2
|
+
export declare const useConfigurationOptions: () => Required<import("../..").ModalOptions>;
|
|
8
3
|
export declare const useConfigurationDuration: () => {
|
|
9
4
|
duration: `${number}ms`;
|
|
10
5
|
milliseconds: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Color, Duration } from '../@aileron/declare';
|
|
2
|
+
export interface ModalOptions {
|
|
3
|
+
/** Modal transition time(ms, s) */
|
|
4
|
+
duration?: Duration;
|
|
5
|
+
/** Modal backdrop color */
|
|
6
|
+
backdrop?: Color;
|
|
7
|
+
/** Whether to destroy the modal manually */
|
|
8
|
+
manualDestroy?: boolean;
|
|
9
|
+
/** Whether to close the modal when the backdrop is clicked */
|
|
10
|
+
closeOnBackdropClick?: boolean;
|
|
11
|
+
}
|
package/package.json
CHANGED