@stenajs-webui/modal 19.0.5 → 20.0.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/building-blocks/ModalActionButtons.d.ts +6 -0
- package/dist/building-blocks/ModalBody.d.ts +5 -0
- package/dist/building-blocks/ModalHeader.d.ts +6 -0
- package/dist/building-blocks/ModalHeading.d.ts +5 -0
- package/dist/common-types.d.ts +3 -0
- package/dist/{components → declarative-modals}/drawer/Drawer.d.ts +1 -3
- package/dist/{components/center-modal/CenterModal.d.ts → declarative-modals/modal/Modal.d.ts} +1 -1
- package/dist/{components/modal/BaseModal.d.ts → declarative-modals/window/BaseWindow.d.ts} +2 -2
- package/dist/declarative-modals/window/Window.d.ts +11 -0
- package/dist/declarative-modals/window/WindowFooter.d.ts +6 -0
- package/dist/{components/modal/ModalHeader.d.ts → declarative-modals/window/WindowHeader.d.ts} +2 -2
- package/dist/dialog/DialogCommands.d.ts +3 -0
- package/dist/dialog/DialogContext.d.ts +7 -0
- package/dist/dialog/UseDialog.d.ts +23 -0
- package/dist/dialog/UseDialogPromise.d.ts +2 -0
- package/dist/dialog/alert/UseAlertDialog.d.ts +3 -0
- package/dist/dialog/drawer/UseDrawerDialog.d.ts +7 -0
- package/dist/dialog/modal/UseModalDialog.d.ts +3 -0
- package/dist/index.d.ts +20 -8
- package/dist/index.es.js +411 -190
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/ready-made-modals/InfoAlert.d.ts +13 -0
- package/package.json +5 -5
- package/dist/components/modal/Modal.d.ts +0 -11
- package/dist/components/modal/ModalFooter.d.ts +0 -6
- /package/dist/{components → declarative-modals}/drawer/DrawerHeader.d.ts +0 -0
- /package/dist/{components → declarative-modals}/loading-modal/LoadingModal.d.ts +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ReactModal from "react-modal";
|
|
3
|
-
|
|
4
|
-
export declare type SlideFromLeftRight = "left" | "right";
|
|
5
|
-
export declare type SlideFromTopBottom = "top" | "bottom";
|
|
3
|
+
import { SlideFromLeftRight, SlideFromTopBottom } from "../../common-types";
|
|
6
4
|
export declare type DrawerProps = DrawerBaseLeftRight | DrawerBaseTopBottom;
|
|
7
5
|
interface DrawerBaseLeftRight extends DrawerBaseProps {
|
|
8
6
|
width?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ReactModal from "react-modal";
|
|
3
|
-
export interface
|
|
3
|
+
export interface BaseWindowProps extends ReactModal.Props {
|
|
4
4
|
width?: string;
|
|
5
5
|
maxWidth?: string;
|
|
6
6
|
onRequestClose?: () => void;
|
|
@@ -8,4 +8,4 @@ export interface BaseModalProps extends ReactModal.Props {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const DRAGGABLE_HANDLE_CLASSNAME = "draggable-modal-handle";
|
|
10
10
|
export declare const DRAGGABLE_CANCEL_CLASSNAME = "draggable-modal-cancel";
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const BaseWindow: React.FC<BaseWindowProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { BaseWindowProps } from "./BaseWindow";
|
|
3
|
+
import { WindowHeaderProps } from "./WindowHeader";
|
|
4
|
+
export interface WindowProps extends BaseWindowProps, WindowHeaderProps {
|
|
5
|
+
spacing?: number;
|
|
6
|
+
indent?: number;
|
|
7
|
+
draggable?: boolean;
|
|
8
|
+
footer?: React.ReactNode;
|
|
9
|
+
disableStickyFooter?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Window: React.FC<WindowProps>;
|
package/dist/{components/modal/ModalHeader.d.ts → declarative-modals/window/WindowHeader.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface WindowHeaderProps {
|
|
4
4
|
onRequestClose?: () => void;
|
|
5
5
|
header?: ReactNode;
|
|
6
6
|
headerText?: string;
|
|
7
7
|
closeButtonClassName?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const WindowHeader: React.FC<WindowHeaderProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare type ShowCommand<TProps, TPromiseResolve> = keyof TProps extends never ? () => Promise<TPromiseResolve | undefined> : (props: TProps) => Promise<TPromiseResolve | undefined>;
|
|
2
|
+
export declare type ResolveCommand<TPromiseResolve> = (resolveValue: TPromiseResolve) => void;
|
|
3
|
+
export declare type RejectCommand = (error?: Error) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RejectCommand, ResolveCommand } from "./DialogCommands";
|
|
3
|
+
export interface DialogContextValue<TResolveValue> {
|
|
4
|
+
resolve: ResolveCommand<TResolveValue>;
|
|
5
|
+
reject: RejectCommand;
|
|
6
|
+
}
|
|
7
|
+
export declare const DialogContext: import("react").Context<DialogContextValue<any> | undefined>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode, RefObject } from "react";
|
|
2
|
+
import { RejectCommand, ShowCommand } from "./DialogCommands";
|
|
3
|
+
declare type UseDialogCallbacks<TProps, TPromiseResolve> = {
|
|
4
|
+
show: ShowCommand<TProps, TPromiseResolve>;
|
|
5
|
+
reject: RejectCommand;
|
|
6
|
+
};
|
|
7
|
+
export declare type UseDialogResult<TProps, TPromiseResolve> = [
|
|
8
|
+
ReactNode,
|
|
9
|
+
UseDialogCallbacks<TProps, TPromiseResolve>
|
|
10
|
+
];
|
|
11
|
+
export interface DialogOptions {
|
|
12
|
+
disableCloseOnClickOutside?: boolean;
|
|
13
|
+
modal: boolean;
|
|
14
|
+
className: string;
|
|
15
|
+
closingClassName: string;
|
|
16
|
+
contentWrapperClassName: string;
|
|
17
|
+
dialogStyle?: CSSProperties;
|
|
18
|
+
ref?: RefObject<HTMLDialogElement>;
|
|
19
|
+
onResolve?: () => void;
|
|
20
|
+
onReject?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function useDialog<TProps, TPromiseResolve = void>(component: React.FC<TProps>, options: DialogOptions): UseDialogResult<TProps, TPromiseResolve>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DialogOptions, UseDialogResult } from "../UseDialog";
|
|
3
|
+
import { SlideFrom } from "../../common-types";
|
|
4
|
+
interface DrawerOptions extends Partial<Omit<DialogOptions, "disableCloseOnClickOutside">> {
|
|
5
|
+
}
|
|
6
|
+
export declare function useDrawerDialog<TProps, TPromiseResolve = void>(component: React.FC<TProps>, slideFrom?: SlideFrom, options?: DrawerOptions): UseDialogResult<TProps, TPromiseResolve>;
|
|
7
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
1
|
+
export * from "./common-types";
|
|
2
|
+
export * from "./declarative-modals/window/BaseWindow";
|
|
3
|
+
export * from "./declarative-modals/drawer/Drawer";
|
|
4
|
+
export * from "./declarative-modals/drawer/DrawerHeader";
|
|
5
|
+
export * from "./declarative-modals/modal/Modal";
|
|
6
|
+
export * from "./declarative-modals/loading-modal/LoadingModal";
|
|
7
|
+
export * from "./declarative-modals/window/Window";
|
|
8
|
+
export * from "./declarative-modals/window/WindowHeader";
|
|
9
|
+
export * from "./declarative-modals/window/WindowFooter";
|
|
10
|
+
export * from "./dialog/UseDialog";
|
|
11
|
+
export * from "./dialog/UseDialogPromise";
|
|
12
|
+
export * from "./dialog/DialogCommands";
|
|
13
|
+
export * from "./dialog/alert/UseAlertDialog";
|
|
14
|
+
export * from "./dialog/drawer/UseDrawerDialog";
|
|
15
|
+
export * from "./dialog/modal/UseModalDialog";
|
|
16
|
+
export * from "./ready-made-modals/InfoAlert";
|
|
17
|
+
export * from "./building-blocks/ModalHeader";
|
|
18
|
+
export * from "./building-blocks/ModalActionButtons";
|
|
19
|
+
export * from "./building-blocks/ModalHeading";
|
|
20
|
+
export * from "./building-blocks/ModalBody";
|