@yamada-ui/modal 1.3.12-next-20241005220055 → 1.3.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-KNCDANWW.mjs → chunk-37MTMX5B.mjs} +3 -3
- package/dist/{chunk-KNCDANWW.mjs.map → chunk-37MTMX5B.mjs.map} +1 -1
- package/dist/{chunk-SHVXETTC.mjs → chunk-6XAWCUQQ.mjs} +3 -3
- package/dist/{chunk-SHVXETTC.mjs.map → chunk-6XAWCUQQ.mjs.map} +1 -1
- package/dist/{chunk-3K5JY6KM.mjs → chunk-7EVREJIH.mjs} +19 -19
- package/dist/chunk-7EVREJIH.mjs.map +1 -0
- package/dist/{chunk-IIKFZB3M.mjs → chunk-7I5LX3VI.mjs} +43 -43
- package/dist/chunk-7I5LX3VI.mjs.map +1 -0
- package/dist/{chunk-3BTHYYAS.mjs → chunk-7THNENCM.mjs} +36 -32
- package/dist/chunk-7THNENCM.mjs.map +1 -0
- package/dist/{chunk-4J4ISPN7.mjs → chunk-A7WOQJCA.mjs} +1 -1
- package/dist/chunk-A7WOQJCA.mjs.map +1 -0
- package/dist/{chunk-2LLDUYTG.mjs → chunk-BNRFPNWF.mjs} +3 -3
- package/dist/{chunk-2LLDUYTG.mjs.map → chunk-BNRFPNWF.mjs.map} +1 -1
- package/dist/{chunk-HUI5FLPV.mjs → chunk-EDCPPJBS.mjs} +3 -3
- package/dist/{chunk-HUI5FLPV.mjs.map → chunk-EDCPPJBS.mjs.map} +1 -1
- package/dist/{chunk-XKKFTAXR.mjs → chunk-G7R3GU24.mjs} +3 -3
- package/dist/{chunk-XKKFTAXR.mjs.map → chunk-G7R3GU24.mjs.map} +1 -1
- package/dist/{chunk-LG73B7RP.mjs → chunk-L353QQ6S.mjs} +4 -4
- package/dist/{chunk-LG73B7RP.mjs.map → chunk-L353QQ6S.mjs.map} +1 -1
- package/dist/{chunk-BQAR3Q4F.mjs → chunk-LUSTM3GA.mjs} +3 -3
- package/dist/{chunk-SIKHBBVB.mjs → chunk-LYMMHCHF.mjs} +4 -4
- package/dist/{chunk-SIKHBBVB.mjs.map → chunk-LYMMHCHF.mjs.map} +1 -1
- package/dist/{chunk-K4MJNSAV.mjs → chunk-OAECULYV.mjs} +2 -2
- package/dist/{chunk-LK36SQZ5.mjs → chunk-P5SCGBP7.mjs} +19 -19
- package/dist/{chunk-LK36SQZ5.mjs.map → chunk-P5SCGBP7.mjs.map} +1 -1
- package/dist/{chunk-VSX32COP.mjs → chunk-PDW7A62B.mjs} +3 -3
- package/dist/{chunk-VSX32COP.mjs.map → chunk-PDW7A62B.mjs.map} +1 -1
- package/dist/{chunk-LD26U4D3.mjs → chunk-TXXRGDQR.mjs} +3 -3
- package/dist/{chunk-LD26U4D3.mjs.map → chunk-TXXRGDQR.mjs.map} +1 -1
- package/dist/{chunk-LTFXOP3I.mjs → chunk-VB44U6WY.mjs} +10 -10
- package/dist/{chunk-LTFXOP3I.mjs.map → chunk-VB44U6WY.mjs.map} +1 -1
- package/dist/{chunk-XFLVRTWU.mjs → chunk-VMTMWWII.mjs} +3 -3
- package/dist/{chunk-XFLVRTWU.mjs.map → chunk-VMTMWWII.mjs.map} +1 -1
- package/dist/{chunk-6NMJJILM.mjs → chunk-VNQHFTL2.mjs} +3 -3
- package/dist/{chunk-6NMJJILM.mjs.map → chunk-VNQHFTL2.mjs.map} +1 -1
- package/dist/{chunk-WK6DQSTW.mjs → chunk-W7WF42SC.mjs} +3 -3
- package/dist/{chunk-WK6DQSTW.mjs.map → chunk-W7WF42SC.mjs.map} +1 -1
- package/dist/{chunk-TLLVKBMP.mjs → chunk-ZDEVCYYC.mjs} +5 -5
- package/dist/{chunk-TLLVKBMP.mjs.map → chunk-ZDEVCYYC.mjs.map} +1 -1
- package/dist/{chunk-ZRQKYX2B.mjs → chunk-ZVXKXIPM.mjs} +40 -40
- package/dist/chunk-ZVXKXIPM.mjs.map +1 -0
- package/dist/dialog-body.js +2 -2
- package/dist/dialog-body.js.map +1 -1
- package/dist/dialog-body.mjs +3 -3
- package/dist/dialog-close-button.js +1 -1
- package/dist/dialog-close-button.js.map +1 -1
- package/dist/dialog-close-button.mjs +3 -3
- package/dist/dialog-footer.js +1 -1
- package/dist/dialog-footer.js.map +1 -1
- package/dist/dialog-footer.mjs +3 -3
- package/dist/dialog-header.js +1 -1
- package/dist/dialog-header.js.map +1 -1
- package/dist/dialog-header.mjs +3 -3
- package/dist/dialog-overlay.js +8 -8
- package/dist/dialog-overlay.js.map +1 -1
- package/dist/dialog-overlay.mjs +3 -3
- package/dist/dialog.d.mts +6 -6
- package/dist/dialog.d.ts +6 -6
- package/dist/dialog.js +97 -94
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +18 -18
- package/dist/drawer-body.js +2 -2
- package/dist/drawer-body.js.map +1 -1
- package/dist/drawer-body.mjs +3 -3
- package/dist/drawer-close-button.js +1 -1
- package/dist/drawer-close-button.js.map +1 -1
- package/dist/drawer-close-button.mjs +3 -3
- package/dist/drawer-content.d.mts +1 -1
- package/dist/drawer-content.d.ts +1 -1
- package/dist/drawer-content.js +15 -15
- package/dist/drawer-content.js.map +1 -1
- package/dist/drawer-content.mjs +5 -5
- package/dist/drawer-drag-bar.js.map +1 -1
- package/dist/drawer-drag-bar.mjs +2 -2
- package/dist/drawer-footer.js +1 -1
- package/dist/drawer-footer.js.map +1 -1
- package/dist/drawer-footer.mjs +3 -3
- package/dist/drawer-header.js +1 -1
- package/dist/drawer-header.js.map +1 -1
- package/dist/drawer-header.mjs +3 -3
- package/dist/drawer-overlay.js +8 -8
- package/dist/drawer-overlay.js.map +1 -1
- package/dist/drawer-overlay.mjs +3 -3
- package/dist/drawer.d.mts +17 -17
- package/dist/drawer.d.ts +17 -17
- package/dist/drawer.js +104 -104
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +12 -12
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +428 -419
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/modal-body.js +2 -2
- package/dist/modal-body.js.map +1 -1
- package/dist/modal-body.mjs +2 -2
- package/dist/modal-close-button.js +1 -1
- package/dist/modal-close-button.js.map +1 -1
- package/dist/modal-close-button.mjs +2 -2
- package/dist/modal-content.d.mts +1 -1
- package/dist/modal-content.d.ts +1 -1
- package/dist/modal-content.js +15 -15
- package/dist/modal-content.js.map +1 -1
- package/dist/modal-content.mjs +4 -4
- package/dist/modal-context.d.mts +3 -3
- package/dist/modal-context.d.ts +3 -3
- package/dist/modal-context.js.map +1 -1
- package/dist/modal-context.mjs +1 -1
- package/dist/modal-footer.js +1 -1
- package/dist/modal-footer.js.map +1 -1
- package/dist/modal-footer.mjs +2 -2
- package/dist/modal-header.js +1 -1
- package/dist/modal-header.js.map +1 -1
- package/dist/modal-header.mjs +2 -2
- package/dist/modal-overlay.js +8 -8
- package/dist/modal-overlay.js.map +1 -1
- package/dist/modal-overlay.mjs +2 -2
- package/dist/modal.d.mts +46 -46
- package/dist/modal.d.ts +46 -46
- package/dist/modal.js +71 -71
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +11 -11
- package/package.json +10 -10
- package/dist/chunk-3BTHYYAS.mjs.map +0 -1
- package/dist/chunk-3K5JY6KM.mjs.map +0 -1
- package/dist/chunk-4J4ISPN7.mjs.map +0 -1
- package/dist/chunk-IIKFZB3M.mjs.map +0 -1
- package/dist/chunk-ZRQKYX2B.mjs.map +0 -1
- /package/dist/{chunk-BQAR3Q4F.mjs.map → chunk-LUSTM3GA.mjs.map} +0 -0
- /package/dist/{chunk-K4MJNSAV.mjs.map → chunk-OAECULYV.mjs.map} +0 -0
package/dist/modal-content.js
CHANGED
@@ -66,11 +66,11 @@ var ModalCloseButton = (0, import_core.forwardRef)(
|
|
66
66
|
{
|
67
67
|
ref,
|
68
68
|
className: (0, import_utils2.cx)("ui-modal__close-button"),
|
69
|
-
__css: css,
|
70
69
|
onClick: (0, import_utils2.handlerAll)(onClick, (ev) => {
|
71
70
|
ev.stopPropagation();
|
72
71
|
onClose == null ? void 0 : onClose();
|
73
72
|
}),
|
73
|
+
__css: css,
|
74
74
|
...rest
|
75
75
|
}
|
76
76
|
);
|
@@ -106,39 +106,39 @@ var getModalContentProps = (animation = "scale", duration) => {
|
|
106
106
|
case "scale":
|
107
107
|
return {
|
108
108
|
...import_transitions.scaleFadeProps,
|
109
|
-
custom: {
|
109
|
+
custom: { duration, reverse: true, scale: 0.95 }
|
110
110
|
};
|
111
111
|
case "top":
|
112
112
|
return {
|
113
113
|
...import_transitions.slideFadeProps,
|
114
|
-
custom: { offsetY: -16, reverse: true
|
114
|
+
custom: { duration, offsetY: -16, reverse: true }
|
115
115
|
};
|
116
116
|
case "right":
|
117
117
|
return {
|
118
118
|
...import_transitions.slideFadeProps,
|
119
|
-
custom: { offsetX: 16, reverse: true
|
119
|
+
custom: { duration, offsetX: 16, reverse: true }
|
120
120
|
};
|
121
121
|
case "left":
|
122
122
|
return {
|
123
123
|
...import_transitions.slideFadeProps,
|
124
|
-
custom: { offsetX: -16, reverse: true
|
124
|
+
custom: { duration, offsetX: -16, reverse: true }
|
125
125
|
};
|
126
126
|
case "bottom":
|
127
127
|
return {
|
128
128
|
...import_transitions.slideFadeProps,
|
129
|
-
custom: { offsetY: 16, reverse: true
|
129
|
+
custom: { duration, offsetY: 16, reverse: true }
|
130
130
|
};
|
131
131
|
}
|
132
132
|
};
|
133
133
|
var ModalContent = (0, import_motion.motionForwardRef)(
|
134
134
|
({ className, children, __css, ...rest }, ref) => {
|
135
135
|
const {
|
136
|
-
|
136
|
+
animation,
|
137
|
+
duration,
|
137
138
|
scrollBehavior,
|
139
|
+
styles,
|
138
140
|
withCloseButton,
|
139
|
-
onClose
|
140
|
-
animation,
|
141
|
-
duration
|
141
|
+
onClose
|
142
142
|
} = useModal();
|
143
143
|
const validChildren = (0, import_utils4.getValidChildren)(children);
|
144
144
|
const [customModalCloseButton, ...cloneChildren] = (0, import_utils4.findChildren)(
|
@@ -148,21 +148,21 @@ var ModalContent = (0, import_motion.motionForwardRef)(
|
|
148
148
|
);
|
149
149
|
const props = animation !== "none" ? getModalContentProps(animation, duration) : {};
|
150
150
|
const css = {
|
151
|
-
position: "relative",
|
152
|
-
maxH: "100%",
|
153
151
|
display: "flex",
|
154
152
|
flexDirection: "column",
|
155
|
-
|
153
|
+
maxH: "100%",
|
156
154
|
outline: 0,
|
155
|
+
overflow: scrollBehavior === "inside" ? "hidden" : "auto",
|
156
|
+
position: "relative",
|
157
157
|
...__css ? __css : styles.container
|
158
158
|
};
|
159
159
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
160
160
|
import_motion.motion.section,
|
161
161
|
{
|
162
|
-
role: "dialog",
|
163
|
-
"aria-modal": "true",
|
164
162
|
ref,
|
165
163
|
className: (0, import_utils4.cx)("ui-modal", className),
|
164
|
+
"aria-modal": "true",
|
165
|
+
role: "dialog",
|
166
166
|
tabIndex: -1,
|
167
167
|
__css: css,
|
168
168
|
...props,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/modal-content.tsx","../src/dialog-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps, MotionTransitionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { scaleFadeProps, slideFadeProps } from \"@yamada-ui/transitions\"\nimport { cx,
|
1
|
+
{"version":3,"sources":["../src/modal-content.tsx","../src/dialog-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps, MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PropsWithChildren } from \"react\"\nimport type { ModalProps } from \"./modal\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { scaleFadeProps, slideFadeProps } from \"@yamada-ui/transitions\"\nimport { cx, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { DialogCloseButton } from \"./dialog-close-button\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useModal } from \"./modal-context\"\n\nconst getModalContentProps = (\n animation: ModalProps[\"animation\"] = \"scale\",\n duration?: MotionTransitionProps[\"duration\"],\n) => {\n switch (animation) {\n case \"scale\":\n return {\n ...scaleFadeProps,\n custom: { duration, reverse: true, scale: 0.95 },\n }\n case \"top\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: -16, reverse: true },\n }\n case \"right\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: 16, reverse: true },\n }\n case \"left\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetX: -16, reverse: true },\n }\n case \"bottom\":\n return {\n ...slideFadeProps,\n custom: { duration, offsetY: 16, reverse: true },\n }\n }\n}\n\nexport interface ModalContentProps\n extends Omit<\n MotionProps<\"section\">,\n \"animation\" | \"children\" | \"scrollBehavior\" | \"transition\"\n >,\n PropsWithChildren {}\n\nexport const ModalContent = motionForwardRef<ModalContentProps, \"section\">(\n ({ className, children, __css, ...rest }, ref) => {\n const {\n animation,\n duration,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n } = useModal()\n\n const validChildren = getValidChildren(children)\n\n const [customModalCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n ModalCloseButton,\n DialogCloseButton,\n )\n\n const props =\n animation !== \"none\" ? getModalContentProps(animation, duration) : {}\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n maxH: \"100%\",\n outline: 0,\n overflow: scrollBehavior === \"inside\" ? \"hidden\" : \"auto\",\n position: \"relative\",\n ...(__css ? __css : styles.container),\n }\n\n return (\n <motion.section\n ref={ref}\n className={cx(\"ui-modal\", className)}\n aria-modal=\"true\"\n role=\"dialog\"\n tabIndex={-1}\n __css={css}\n {...props}\n {...rest}\n >\n {customModalCloseButton ??\n (withCloseButton && onClose ? <ModalCloseButton /> : null)}\n\n {cloneChildren}\n </motion.section>\n )\n },\n)\n\nModalContent.displayName = \"ModalContent\"\nModalContent.__ui__ = \"ModalContent\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalCloseButton } from \"./modal-close-button\"\nimport { useDialog } from \"./modal-context\"\n\nexport interface DialogCloseButtonProps extends CloseButtonProps {}\n\nexport const DialogCloseButton = forwardRef<DialogCloseButtonProps, \"button\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.closeButton }\n\n return (\n <ModalCloseButton\n ref={ref}\n className={cx(\"ui-dialog__close-button\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogCloseButton.displayName = \"DialogCloseButton\"\nDialogCloseButton.__ui__ = \"DialogCloseButton\"\n","import type { CloseButtonProps } from \"@yamada-ui/close-button\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport { CloseButton } from \"@yamada-ui/close-button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalCloseButtonProps extends CloseButtonProps {}\n\nexport const ModalCloseButton = forwardRef<ModalCloseButtonProps, \"button\">(\n ({ onClick, __css, ...rest }, ref) => {\n const { styles, onClose } = useModal()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n ...(__css ? __css : styles.closeButton),\n }\n\n return (\n <CloseButton\n ref={ref}\n className={cx(\"ui-modal__close-button\")}\n onClick={handlerAll(onClick, (ev) => {\n ev.stopPropagation()\n onClose?.()\n })}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalCloseButton.displayName = \"ModalCloseButton\"\nModalCloseButton.__ui__ = \"ModalCloseButton\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":"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","names":["import_utils","import_core","import_utils","import_utils","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/modal-content.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalContent
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
7
|
-
import "./chunk-
|
4
|
+
} from "./chunk-7EVREJIH.mjs";
|
5
|
+
import "./chunk-LUSTM3GA.mjs";
|
6
|
+
import "./chunk-PDW7A62B.mjs";
|
7
|
+
import "./chunk-A7WOQJCA.mjs";
|
8
8
|
export {
|
9
9
|
ModalContent
|
10
10
|
};
|
package/dist/modal-context.d.mts
CHANGED
@@ -8,18 +8,18 @@ import './modal-content.mjs';
|
|
8
8
|
|
9
9
|
interface ModalContext extends ModalOptions {
|
10
10
|
styles: {
|
11
|
-
[key: string]: CSSUIObject;
|
11
|
+
[key: string]: CSSUIObject | undefined;
|
12
12
|
};
|
13
13
|
}
|
14
14
|
declare const ModalProvider: react.Provider<ModalContext>;
|
15
15
|
declare const useModal: () => ModalContext;
|
16
16
|
interface DialogContext {
|
17
|
-
[key: string]: CSSUIObject;
|
17
|
+
[key: string]: CSSUIObject | undefined;
|
18
18
|
}
|
19
19
|
declare const DialogProvider: react.Provider<DialogContext>;
|
20
20
|
declare const useDialog: () => DialogContext;
|
21
21
|
interface DrawerContext {
|
22
|
-
[key: string]: CSSUIObject;
|
22
|
+
[key: string]: CSSUIObject | undefined;
|
23
23
|
}
|
24
24
|
declare const DrawerProvider: react.Provider<DrawerContext>;
|
25
25
|
declare const useDrawer: () => DrawerContext;
|
package/dist/modal-context.d.ts
CHANGED
@@ -8,18 +8,18 @@ import './modal-content.js';
|
|
8
8
|
|
9
9
|
interface ModalContext extends ModalOptions {
|
10
10
|
styles: {
|
11
|
-
[key: string]: CSSUIObject;
|
11
|
+
[key: string]: CSSUIObject | undefined;
|
12
12
|
};
|
13
13
|
}
|
14
14
|
declare const ModalProvider: react.Provider<ModalContext>;
|
15
15
|
declare const useModal: () => ModalContext;
|
16
16
|
interface DialogContext {
|
17
|
-
[key: string]: CSSUIObject;
|
17
|
+
[key: string]: CSSUIObject | undefined;
|
18
18
|
}
|
19
19
|
declare const DialogProvider: react.Provider<DialogContext>;
|
20
20
|
declare const useDialog: () => DialogContext;
|
21
21
|
interface DrawerContext {
|
22
|
-
[key: string]: CSSUIObject;
|
22
|
+
[key: string]: CSSUIObject | undefined;
|
23
23
|
}
|
24
24
|
declare const DrawerProvider: react.Provider<DrawerContext>;
|
25
25
|
declare const useDrawer: () => DrawerContext;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8B;AAMvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}
|
package/dist/modal-context.mjs
CHANGED
package/dist/modal-footer.js
CHANGED
@@ -48,8 +48,8 @@ var ModalFooter = (0, import_core.forwardRef)(
|
|
48
48
|
({ className, __css, ...rest }, ref) => {
|
49
49
|
const { styles } = useModal();
|
50
50
|
const css = {
|
51
|
-
display: "flex",
|
52
51
|
alignItems: "center",
|
52
|
+
display: "flex",
|
53
53
|
justifyContent: "flex-end",
|
54
54
|
...__css ? __css : styles.footer
|
55
55
|
};
|
package/dist/modal-footer.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/modal-footer.tsx","../src/modal-context.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"sources":["../src/modal-footer.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalFooterProps extends HTMLUIProps<\"footer\"> {}\n\nexport const ModalFooter = forwardRef<ModalFooterProps, \"footer\">(\n ({ className, __css, ...rest }, ref) => {\n const { styles } = useModal()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"flex-end\",\n ...(__css ? __css : styles.footer),\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-modal__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalFooter.displayName = \"ModalFooter\"\nModalFooter.__ui__ = \"ModalFooter\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACAnB,mBAA8B;AAMvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADVK;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAC1B,YAAY,SAAS;","names":["import_utils"]}
|
package/dist/modal-footer.mjs
CHANGED
package/dist/modal-header.js
CHANGED
@@ -48,8 +48,8 @@ var ModalHeader = (0, import_core.forwardRef)(
|
|
48
48
|
({ className, __css, ...rest }, ref) => {
|
49
49
|
const { styles } = useModal();
|
50
50
|
const css = {
|
51
|
-
display: "flex",
|
52
51
|
alignItems: "center",
|
52
|
+
display: "flex",
|
53
53
|
justifyContent: "flex-start",
|
54
54
|
...__css ? __css : styles.header
|
55
55
|
};
|
package/dist/modal-header.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/modal-header.tsx","../src/modal-context.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"sources":["../src/modal-header.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalHeaderProps extends HTMLUIProps<\"header\"> {}\n\nexport const ModalHeader = forwardRef<ModalHeaderProps, \"header\">(\n ({ className, __css, ...rest }, ref) => {\n const { styles } = useModal()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n ...(__css ? __css : styles.header),\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-modal__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalHeader.displayName = \"ModalHeader\"\nModalHeader.__ui__ = \"ModalHeader\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACAnB,mBAA8B;AAMvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADVK;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAC1B,YAAY,SAAS;","names":["import_utils"]}
|
package/dist/modal-header.mjs
CHANGED
package/dist/modal-overlay.js
CHANGED
@@ -46,21 +46,21 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
46
46
|
// src/modal-overlay.tsx
|
47
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
48
48
|
var ModalOverlay = (0, import_motion.motionForwardRef)(
|
49
|
-
({ className,
|
49
|
+
({ className, onClick, __css, ...rest }, ref) => {
|
50
50
|
const {
|
51
|
-
|
51
|
+
animation,
|
52
52
|
closeOnOverlay,
|
53
|
-
|
53
|
+
duration,
|
54
|
+
styles,
|
54
55
|
onClose,
|
55
|
-
|
56
|
-
duration
|
56
|
+
onOverlayClick
|
57
57
|
} = useModal();
|
58
58
|
const css = {
|
59
|
+
h: "100dvh",
|
60
|
+
left: 0,
|
59
61
|
position: "fixed",
|
60
62
|
top: 0,
|
61
|
-
left: 0,
|
62
63
|
w: "100vw",
|
63
|
-
h: "100dvh",
|
64
64
|
...__css ? __css : styles.overlay
|
65
65
|
};
|
66
66
|
const props = animation !== "none" ? import_transitions.fadeProps : {};
|
@@ -70,11 +70,11 @@ var ModalOverlay = (0, import_motion.motionForwardRef)(
|
|
70
70
|
ref,
|
71
71
|
className: (0, import_utils2.cx)("ui-modal__overlay", className),
|
72
72
|
custom: { duration },
|
73
|
-
__css: css,
|
74
73
|
onClick: (0, import_utils2.handlerAll)(onClick, onOverlayClick, (ev) => {
|
75
74
|
ev.stopPropagation();
|
76
75
|
if (closeOnOverlay) onClose == null ? void 0 : onClose();
|
77
76
|
}),
|
77
|
+
__css: css,
|
78
78
|
...props,
|
79
79
|
...rest
|
80
80
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/modal-overlay.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { fadeProps } from \"@yamada-ui/transitions\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalOverlayProps extends MotionProps {}\n\nexport const ModalOverlay = motionForwardRef<ModalOverlayProps, \"div\">(\n ({ className,
|
1
|
+
{"version":3,"sources":["../src/modal-overlay.tsx","../src/modal-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { fadeProps } from \"@yamada-ui/transitions\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalOverlayProps extends MotionProps {}\n\nexport const ModalOverlay = motionForwardRef<ModalOverlayProps, \"div\">(\n ({ className, onClick, __css, ...rest }, ref) => {\n const {\n animation,\n closeOnOverlay,\n duration,\n styles,\n onClose,\n onOverlayClick,\n } = useModal()\n\n const css: CSSUIObject = {\n h: \"100dvh\",\n left: 0,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n ...(__css ? __css : styles.overlay),\n }\n\n const props = animation !== \"none\" ? fadeProps : {}\n\n return (\n <motion.div\n ref={ref}\n className={cx(\"ui-modal__overlay\", className)}\n custom={{ duration }}\n onClick={handlerAll(onClick, onOverlayClick, (ev) => {\n ev.stopPropagation()\n if (closeOnOverlay) onClose?.()\n })}\n __css={css}\n {...props}\n {...rest}\n />\n )\n },\n)\n\nModalOverlay.displayName = \"ModalOverlay\"\nModalOverlay.__ui__ = \"ModalOverlay\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAyC;AACzC,yBAA0B;AAC1B,IAAAA,gBAA+B;;;ACF/B,mBAA8B;AAMvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADGK;AAvBC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,SAAS,OAAO,GAAG,KAAK,GAAG,QAAQ;AAC/C,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,SAAS;AAEb,UAAM,MAAmB;AAAA,MACvB,GAAG;AAAA,MACH,MAAM;AAAA,MACN,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,UAAM,QAAQ,cAAc,SAAS,+BAAY,CAAC;AAElD,WACE;AAAA,MAAC,qBAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,QAAQ,EAAE,SAAS;AAAA,QACnB,aAAS,0BAAW,SAAS,gBAAgB,CAAC,OAAO;AACnD,aAAG,gBAAgB;AACnB,cAAI,eAAgB;AAAA,QACtB,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":["import_utils"]}
|
package/dist/modal-overlay.mjs
CHANGED
package/dist/modal.d.mts
CHANGED
@@ -1,60 +1,60 @@
|
|
1
1
|
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
2
2
|
import { MotionTransitionProps } from '@yamada-ui/motion';
|
3
|
-
import {
|
3
|
+
import { CSSUIProps, Token, HTMLUIProps, ThemeProps } from '@yamada-ui/core';
|
4
4
|
import { FocusLockProps } from '@yamada-ui/focus-lock';
|
5
5
|
import { PortalProps } from '@yamada-ui/portal';
|
6
6
|
import { ModalContentProps } from './modal-content.mjs';
|
7
7
|
import 'react';
|
8
8
|
|
9
|
-
interface ModalOptions extends Pick<FocusLockProps, "autoFocus" | "
|
9
|
+
interface ModalOptions extends Pick<FocusLockProps, "autoFocus" | "finalFocusRef" | "initialFocusRef" | "lockFocusAcrossFrames" | "restoreFocus"> {
|
10
10
|
/**
|
11
11
|
* If `true`, the open will be opened.
|
12
12
|
*/
|
13
13
|
isOpen: boolean;
|
14
14
|
/**
|
15
|
-
*
|
16
|
-
|
17
|
-
|
18
|
-
/**
|
19
|
-
* Callback fired when the overlay is clicked.
|
20
|
-
*/
|
21
|
-
onOverlayClick?: () => void;
|
22
|
-
/**
|
23
|
-
* Callback fired when the escape key is pressed and focus is within modal.
|
24
|
-
*/
|
25
|
-
onEsc?(): void;
|
26
|
-
/**
|
27
|
-
* Callback function to run side effects after the modal has closed.
|
15
|
+
* Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.
|
16
|
+
*
|
17
|
+
* @default false.
|
28
18
|
*/
|
29
|
-
|
19
|
+
allowPinchZoom?: boolean;
|
30
20
|
/**
|
31
|
-
* The
|
21
|
+
* The animation of the tooltip.
|
32
22
|
*
|
33
|
-
* @default '
|
23
|
+
* @default 'scale'
|
34
24
|
*/
|
35
|
-
|
25
|
+
animation?: "bottom" | "left" | "none" | "right" | "scale" | "top";
|
36
26
|
/**
|
37
|
-
*
|
27
|
+
* If `true`, scrolling will be disabled on the `body` when the modal opens.
|
28
|
+
*
|
29
|
+
* @default true
|
38
30
|
*/
|
39
|
-
|
31
|
+
blockScrollOnMount?: boolean;
|
40
32
|
/**
|
41
|
-
* If `true`,
|
33
|
+
* If `true`, the modal will close when the `Esc` key is pressed.
|
42
34
|
*
|
43
35
|
* @default true
|
44
36
|
*/
|
45
|
-
|
37
|
+
closeOnEsc?: boolean;
|
46
38
|
/**
|
47
|
-
* If `true`,
|
39
|
+
* If `true`, the modal will close when the overlay is clicked.
|
48
40
|
*
|
49
41
|
* @default true
|
50
42
|
*/
|
51
|
-
|
43
|
+
closeOnOverlay?: boolean;
|
52
44
|
/**
|
53
|
-
*
|
45
|
+
* The animation duration.
|
46
|
+
*/
|
47
|
+
duration?: MotionTransitionProps["duration"];
|
48
|
+
/**
|
49
|
+
* The CSS `padding` property.
|
50
|
+
*/
|
51
|
+
outside?: CSSUIProps["p"];
|
52
|
+
/**
|
53
|
+
* The placement of the modal.
|
54
54
|
*
|
55
|
-
* @default
|
55
|
+
* @default 'center'
|
56
56
|
*/
|
57
|
-
|
57
|
+
placement?: Token<"bottom" | "bottom-left" | "bottom-right" | "center" | "left" | "right" | "top" | "top-left" | "top-right">;
|
58
58
|
/**
|
59
59
|
* Where scroll behavior should originate.
|
60
60
|
*
|
@@ -65,41 +65,41 @@ interface ModalOptions extends Pick<FocusLockProps, "autoFocus" | "initialFocusR
|
|
65
65
|
*/
|
66
66
|
scrollBehavior?: "inside" | "outside";
|
67
67
|
/**
|
68
|
-
* If `true`,
|
68
|
+
* If `true`, display the modal close button.
|
69
69
|
*
|
70
70
|
* @default true
|
71
71
|
*/
|
72
|
-
|
72
|
+
withCloseButton?: boolean;
|
73
73
|
/**
|
74
|
-
* If `true`, the modal
|
74
|
+
* If `true`, display the modal overlay.
|
75
75
|
*
|
76
76
|
* @default true
|
77
77
|
*/
|
78
|
-
|
78
|
+
withOverlay?: boolean;
|
79
79
|
/**
|
80
|
-
*
|
81
|
-
*
|
82
|
-
* @default true
|
80
|
+
* Props for modal container element.
|
83
81
|
*/
|
84
|
-
|
82
|
+
containerProps?: HTMLUIProps;
|
85
83
|
/**
|
86
|
-
*
|
87
|
-
*
|
88
|
-
* @default 'scale'
|
84
|
+
* Props to be forwarded to the portal component.
|
89
85
|
*/
|
90
|
-
|
86
|
+
portalProps?: Omit<PortalProps, "children">;
|
91
87
|
/**
|
92
|
-
*
|
88
|
+
* Callback invoked to close the modal.
|
93
89
|
*/
|
94
|
-
|
90
|
+
onClose?: () => void;
|
95
91
|
/**
|
96
|
-
*
|
92
|
+
* Callback function to run side effects after the modal has closed.
|
97
93
|
*/
|
98
|
-
|
94
|
+
onCloseComplete?: () => void;
|
99
95
|
/**
|
100
|
-
*
|
96
|
+
* Callback fired when the escape key is pressed and focus is within modal.
|
101
97
|
*/
|
102
|
-
|
98
|
+
onEsc?(): void;
|
99
|
+
/**
|
100
|
+
* Callback fired when the overlay is clicked.
|
101
|
+
*/
|
102
|
+
onOverlayClick?: () => void;
|
103
103
|
}
|
104
104
|
interface ModalProps extends ModalContentProps, ThemeProps<"Modal">, ModalOptions {
|
105
105
|
}
|