@yamada-ui/modal 1.3.9 → 1.3.10-dev-20240917033401
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/chunk-2EF6C34T.mjs +35 -0
- package/dist/chunk-2EF6C34T.mjs.map +1 -0
- package/dist/chunk-2GGZOTUT.mjs +32 -0
- package/dist/chunk-2GGZOTUT.mjs.map +1 -0
- package/dist/chunk-2UHL64SV.mjs +150 -0
- package/dist/chunk-2UHL64SV.mjs.map +1 -0
- package/dist/chunk-2XQPQIQG.mjs +32 -0
- package/dist/chunk-2XQPQIQG.mjs.map +1 -0
- package/dist/chunk-3CPIBNSS.mjs +32 -0
- package/dist/chunk-3CPIBNSS.mjs.map +1 -0
- package/dist/chunk-3S4JQQU3.mjs +32 -0
- package/dist/chunk-3S4JQQU3.mjs.map +1 -0
- package/dist/chunk-4G6PCQ4G.mjs +51 -0
- package/dist/chunk-4G6PCQ4G.mjs.map +1 -0
- package/dist/chunk-4J4ISPN7.mjs +26 -0
- package/dist/chunk-4J4ISPN7.mjs.map +1 -0
- package/dist/chunk-5OKOSAXO.mjs +37 -0
- package/dist/chunk-5OKOSAXO.mjs.map +1 -0
- package/dist/chunk-B2LUOR6L.mjs +32 -0
- package/dist/chunk-B2LUOR6L.mjs.map +1 -0
- package/dist/chunk-B436JYPR.mjs +34 -0
- package/dist/chunk-B436JYPR.mjs.map +1 -0
- package/dist/chunk-CW5ZZAAV.mjs +34 -0
- package/dist/chunk-CW5ZZAAV.mjs.map +1 -0
- package/dist/chunk-DV6BTDBZ.mjs +32 -0
- package/dist/chunk-DV6BTDBZ.mjs.map +1 -0
- package/dist/chunk-G646NVHY.mjs +176 -0
- package/dist/chunk-G646NVHY.mjs.map +1 -0
- package/dist/chunk-HM447TIY.mjs +32 -0
- package/dist/chunk-HM447TIY.mjs.map +1 -0
- package/dist/chunk-I6LPF3F6.mjs +95 -0
- package/dist/chunk-I6LPF3F6.mjs.map +1 -0
- package/dist/chunk-OFDDT2JT.mjs +32 -0
- package/dist/chunk-OFDDT2JT.mjs.map +1 -0
- package/dist/chunk-RSAJUBWR.mjs +32 -0
- package/dist/chunk-RSAJUBWR.mjs.map +1 -0
- package/dist/chunk-WEDZHILB.mjs +29 -0
- package/dist/chunk-WEDZHILB.mjs.map +1 -0
- package/dist/chunk-Y2QXIJZA.mjs +138 -0
- package/dist/chunk-Y2QXIJZA.mjs.map +1 -0
- package/dist/chunk-Y5NCRCDU.mjs +32 -0
- package/dist/chunk-Y5NCRCDU.mjs.map +1 -0
- package/dist/chunk-ZR2AEIGZ.mjs +116 -0
- package/dist/chunk-ZR2AEIGZ.mjs.map +1 -0
- package/dist/dialog-body.d.mts +8 -0
- package/dist/dialog-body.d.ts +8 -0
- package/dist/dialog-body.js +94 -0
- package/dist/dialog-body.js.map +1 -0
- package/dist/dialog-body.mjs +10 -0
- package/dist/dialog-body.mjs.map +1 -0
- package/dist/dialog-close-button.d.mts +8 -0
- package/dist/dialog-close-button.d.ts +8 -0
- package/dist/dialog-close-button.js +96 -0
- package/dist/dialog-close-button.js.map +1 -0
- package/dist/dialog-close-button.mjs +10 -0
- package/dist/dialog-close-button.mjs.map +1 -0
- package/dist/dialog-footer.d.mts +8 -0
- package/dist/dialog-footer.d.ts +8 -0
- package/dist/dialog-footer.js +91 -0
- package/dist/dialog-footer.js.map +1 -0
- package/dist/dialog-footer.mjs +10 -0
- package/dist/dialog-footer.mjs.map +1 -0
- package/dist/dialog-header.d.mts +8 -0
- package/dist/dialog-header.d.ts +8 -0
- package/dist/dialog-header.js +91 -0
- package/dist/dialog-header.js.map +1 -0
- package/dist/dialog-header.mjs +10 -0
- package/dist/dialog-header.mjs.map +1 -0
- package/dist/dialog-overlay.d.mts +8 -0
- package/dist/dialog-overlay.d.ts +8 -0
- package/dist/dialog-overlay.js +108 -0
- package/dist/dialog-overlay.js.map +1 -0
- package/dist/dialog-overlay.mjs +10 -0
- package/dist/dialog-overlay.mjs.map +1 -0
- package/dist/dialog.d.mts +7 -21
- package/dist/dialog.d.ts +7 -21
- package/dist/dialog.js +593 -678
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +20 -13
- package/dist/drawer-body.d.mts +8 -0
- package/dist/drawer-body.d.ts +8 -0
- package/dist/drawer-body.js +94 -0
- package/dist/drawer-body.js.map +1 -0
- package/dist/drawer-body.mjs +10 -0
- package/dist/drawer-body.mjs.map +1 -0
- package/dist/drawer-close-button.d.mts +9 -0
- package/dist/drawer-close-button.d.ts +9 -0
- package/dist/drawer-close-button.js +96 -0
- package/dist/drawer-close-button.js.map +1 -0
- package/dist/drawer-close-button.mjs +10 -0
- package/dist/drawer-close-button.mjs.map +1 -0
- package/dist/drawer-content.d.mts +16 -0
- package/dist/drawer-content.d.ts +16 -0
- package/dist/drawer-content.js +278 -0
- package/dist/drawer-content.js.map +1 -0
- package/dist/drawer-content.mjs +12 -0
- package/dist/drawer-content.mjs.map +1 -0
- package/dist/drawer-drag-bar.d.mts +8 -0
- package/dist/drawer-drag-bar.d.ts +8 -0
- package/dist/drawer-drag-bar.js +66 -0
- package/dist/drawer-drag-bar.js.map +1 -0
- package/dist/drawer-drag-bar.mjs +9 -0
- package/dist/drawer-drag-bar.mjs.map +1 -0
- package/dist/drawer-footer.d.mts +8 -0
- package/dist/drawer-footer.d.ts +8 -0
- package/dist/drawer-footer.js +91 -0
- package/dist/drawer-footer.js.map +1 -0
- package/dist/drawer-footer.mjs +10 -0
- package/dist/drawer-footer.mjs.map +1 -0
- package/dist/drawer-header.d.mts +8 -0
- package/dist/drawer-header.d.ts +8 -0
- package/dist/drawer-header.js +91 -0
- package/dist/drawer-header.js.map +1 -0
- package/dist/drawer-header.mjs +10 -0
- package/dist/drawer-header.mjs.map +1 -0
- package/dist/drawer-overlay.d.mts +8 -0
- package/dist/drawer-overlay.d.ts +8 -0
- package/dist/drawer-overlay.js +108 -0
- package/dist/drawer-overlay.js.map +1 -0
- package/dist/drawer-overlay.mjs +10 -0
- package/dist/drawer-overlay.mjs.map +1 -0
- package/dist/drawer.d.mts +8 -27
- package/dist/drawer.d.ts +8 -27
- package/dist/drawer.js +405 -640
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +14 -17
- package/dist/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +492 -413
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -18
- package/dist/modal-body.d.mts +3 -2
- package/dist/modal-body.d.ts +3 -2
- package/dist/modal-body.js +13 -856
- package/dist/modal-body.js.map +1 -1
- package/dist/modal-body.mjs +2 -1
- package/dist/modal-close-button.d.mts +3 -2
- package/dist/modal-close-button.d.ts +3 -2
- package/dist/modal-close-button.js +13 -854
- package/dist/modal-close-button.js.map +1 -1
- package/dist/modal-close-button.mjs +2 -1
- package/dist/modal-content.d.mts +9 -0
- package/dist/modal-content.d.ts +9 -0
- package/dist/modal-content.js +178 -0
- package/dist/modal-content.js.map +1 -0
- package/dist/modal-content.mjs +11 -0
- package/dist/modal-content.mjs.map +1 -0
- package/dist/modal-context.d.mts +27 -0
- package/dist/modal-context.d.ts +27 -0
- package/dist/modal-context.js +54 -0
- package/dist/modal-context.js.map +1 -0
- package/dist/modal-context.mjs +18 -0
- package/dist/modal-context.mjs.map +1 -0
- package/dist/modal-footer.d.mts +2 -1
- package/dist/modal-footer.d.ts +2 -1
- package/dist/modal-footer.js +13 -857
- package/dist/modal-footer.js.map +1 -1
- package/dist/modal-footer.mjs +2 -1
- package/dist/modal-header.d.mts +2 -1
- package/dist/modal-header.d.ts +2 -1
- package/dist/modal-header.js +13 -857
- package/dist/modal-header.js.map +1 -1
- package/dist/modal-header.mjs +2 -1
- package/dist/modal-overlay.d.mts +2 -1
- package/dist/modal-overlay.d.ts +2 -1
- package/dist/modal-overlay.js +16 -843
- package/dist/modal-overlay.js.map +1 -1
- package/dist/modal-overlay.mjs +2 -1
- package/dist/modal.d.mts +10 -14
- package/dist/modal.d.ts +10 -14
- package/dist/modal.js +183 -508
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +13 -5
- package/package.json +10 -10
- package/dist/chunk-7PS3HWMF.mjs +0 -938
- package/dist/chunk-7PS3HWMF.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dialog-header.tsx","../src/modal-context.ts","../src/modal-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport type { ModalHeaderProps } from \"./modal-header\"\nimport { ModalHeader } from \"./modal-header\"\n\nexport interface DialogHeaderProps extends ModalHeaderProps {}\n\nexport const DialogHeader = forwardRef<DialogHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.header }\n\n return (\n <ModalHeader\n ref={ref}\n className={cx(\"ui-dialog__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { ModalOptions } from \"./modal\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject }\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\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\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","import type { HTMLUIProps, CSSUIObject } from \"@yamada-ui/core\"\nimport { ui, forwardRef } 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 display: \"flex\",\n alignItems: \"center\",\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAOvB,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;;;AC5BD,kBAA+B;AAC/B,IAAAC,gBAAmB;AAiBb;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,MAAmB;AAAA,MACvB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,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;;;AFXM,IAAAC,sBAAA;AAPC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,OAAO;AAE5C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
3
|
+
|
|
4
|
+
interface DialogOverlayProps extends ModalOverlayProps {
|
|
5
|
+
}
|
|
6
|
+
declare const DialogOverlay: _yamada_ui_motion.MotionComponent<"div", DialogOverlayProps>;
|
|
7
|
+
|
|
8
|
+
export { DialogOverlay, type DialogOverlayProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ModalOverlayProps } from './modal-overlay.js';
|
|
3
|
+
|
|
4
|
+
interface DialogOverlayProps extends ModalOverlayProps {
|
|
5
|
+
}
|
|
6
|
+
declare const DialogOverlay: _yamada_ui_motion.MotionComponent<"div", DialogOverlayProps>;
|
|
7
|
+
|
|
8
|
+
export { DialogOverlay, type DialogOverlayProps };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/dialog-overlay.tsx
|
|
22
|
+
var dialog_overlay_exports = {};
|
|
23
|
+
__export(dialog_overlay_exports, {
|
|
24
|
+
DialogOverlay: () => DialogOverlay
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(dialog_overlay_exports);
|
|
27
|
+
var import_motion2 = require("@yamada-ui/motion");
|
|
28
|
+
var import_utils3 = require("@yamada-ui/utils");
|
|
29
|
+
|
|
30
|
+
// src/modal-context.ts
|
|
31
|
+
var import_utils = require("@yamada-ui/utils");
|
|
32
|
+
var [ModalProvider, useModal] = (0, import_utils.createContext)({
|
|
33
|
+
name: `ModalContext`,
|
|
34
|
+
errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `
|
|
35
|
+
});
|
|
36
|
+
var [DialogProvider, useDialog] = (0, import_utils.createContext)({
|
|
37
|
+
name: `DialogContext`,
|
|
38
|
+
errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" `
|
|
39
|
+
});
|
|
40
|
+
var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
41
|
+
name: `DrawerContext`,
|
|
42
|
+
errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in "<Drawer />" `
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// src/modal-overlay.tsx
|
|
46
|
+
var import_motion = require("@yamada-ui/motion");
|
|
47
|
+
var import_transitions = require("@yamada-ui/transitions");
|
|
48
|
+
var import_utils2 = require("@yamada-ui/utils");
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var ModalOverlay = (0, import_motion.motionForwardRef)(
|
|
51
|
+
({ className, __css, onClick, ...rest }, ref) => {
|
|
52
|
+
const {
|
|
53
|
+
styles,
|
|
54
|
+
closeOnOverlay,
|
|
55
|
+
onOverlayClick,
|
|
56
|
+
onClose,
|
|
57
|
+
animation,
|
|
58
|
+
duration
|
|
59
|
+
} = useModal();
|
|
60
|
+
const css = {
|
|
61
|
+
position: "fixed",
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
w: "100vw",
|
|
65
|
+
h: "100vh",
|
|
66
|
+
...__css ? __css : styles.overlay
|
|
67
|
+
};
|
|
68
|
+
const props = animation !== "none" ? import_transitions.fadeProps : {};
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
import_motion.motion.div,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: (0, import_utils2.cx)("ui-modal__overlay", className),
|
|
74
|
+
custom: { duration },
|
|
75
|
+
__css: css,
|
|
76
|
+
onClick: (0, import_utils2.handlerAll)(onClick, onOverlayClick, (ev) => {
|
|
77
|
+
ev.stopPropagation();
|
|
78
|
+
if (closeOnOverlay) onClose == null ? void 0 : onClose();
|
|
79
|
+
}),
|
|
80
|
+
...props,
|
|
81
|
+
...rest
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// src/dialog-overlay.tsx
|
|
88
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
89
|
+
var DialogOverlay = (0, import_motion2.motionForwardRef)(
|
|
90
|
+
({ className, ...rest }, ref) => {
|
|
91
|
+
const styles = useDialog();
|
|
92
|
+
const css = { ...styles.overlay };
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
94
|
+
ModalOverlay,
|
|
95
|
+
{
|
|
96
|
+
ref,
|
|
97
|
+
className: (0, import_utils3.cx)("ui-dialog__overlay", className),
|
|
98
|
+
__css: css,
|
|
99
|
+
...rest
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
+
0 && (module.exports = {
|
|
106
|
+
DialogOverlay
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=dialog-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dialog-overlay.tsx","../src/modal-context.ts","../src/modal-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\n\nexport interface DialogOverlayProps extends ModalOverlayProps {}\n\nexport const DialogOverlay = motionForwardRef<DialogOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-dialog__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { ModalOptions } from \"./modal\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject }\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\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\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","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, __css, onClick, ...rest }, ref) => {\n const {\n styles,\n closeOnOverlay,\n onOverlayClick,\n onClose,\n animation,\n duration,\n } = useModal()\n\n const css: CSSUIObject = {\n position: \"fixed\",\n top: 0,\n left: 0,\n w: \"100vw\",\n h: \"100vh\",\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 __css={css}\n onClick={handlerAll(onClick, onOverlayClick, (ev) => {\n ev.stopPropagation()\n if (closeOnOverlay) onClose?.()\n })}\n {...props}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,iBAAiC;AACjC,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAOvB,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;;;AC3BD,oBAAyC;AACzC,yBAA0B;AAC1B,IAAAC,gBAA+B;AA4BzB;AAvBC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,OAAO,SAAS,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,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,GAAG;AAAA,MACH,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,OAAO;AAAA,QACP,aAAS,0BAAW,SAAS,gBAAgB,CAAC,OAAO;AACnD,aAAG,gBAAgB;AACnB,cAAI,eAAgB;AAAA,QACtB,CAAC;AAAA,QACA,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;;;AF9BM,IAAAC,sBAAA;AAPC,IAAM,oBAAgB;AAAA,EAC3B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,QAAQ;AAE7C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,sBAAsB,SAAS;AAAA,QAC7C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["import_motion","import_utils","import_utils","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/dialog.d.mts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
-
import { ThemeProps } from '@yamada-ui/core';
|
|
3
1
|
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
4
2
|
import { ButtonProps } from '@yamada-ui/button';
|
|
5
|
-
import {
|
|
3
|
+
import { ThemeProps } from '@yamada-ui/core';
|
|
6
4
|
import { ReactNode } from 'react';
|
|
7
5
|
import { ModalProps } from './modal.mjs';
|
|
8
|
-
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
9
|
-
import { ModalHeaderProps } from './modal-header.mjs';
|
|
10
|
-
import { ModalBodyProps } from './modal-body.mjs';
|
|
11
|
-
import { ModalFooterProps } from './modal-footer.mjs';
|
|
12
6
|
import '@yamada-ui/focus-lock';
|
|
13
7
|
import '@yamada-ui/portal';
|
|
8
|
+
import './modal-content.mjs';
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
interface DialogOptions {
|
|
16
11
|
/**
|
|
17
12
|
* The dialog header to use.
|
|
18
13
|
*/
|
|
@@ -45,23 +40,14 @@ type DialogOptions = {
|
|
|
45
40
|
* The callback invoked when success button clicked.
|
|
46
41
|
*/
|
|
47
42
|
onSuccess?: (onClose: (() => void) | undefined) => void;
|
|
48
|
-
}
|
|
49
|
-
|
|
43
|
+
}
|
|
44
|
+
interface DialogProps extends Omit<ModalProps, keyof ThemeProps>, ThemeProps<"Dialog">, DialogOptions {
|
|
45
|
+
}
|
|
50
46
|
/**
|
|
51
47
|
* `Dialog` is a component used to confirm or interrupt user actions.
|
|
52
48
|
*
|
|
53
49
|
* @see Docs https://yamada-ui.com/components/overlay/dialog
|
|
54
50
|
*/
|
|
55
51
|
declare const Dialog: _yamada_ui_motion.MotionComponent<"section", DialogProps>;
|
|
56
|
-
type DialogOverlayProps = ModalOverlayProps;
|
|
57
|
-
declare const DialogOverlay: _yamada_ui_motion.MotionComponent<"div", ModalOverlayProps>;
|
|
58
|
-
type DialogCloseButtonProps = CloseButtonProps;
|
|
59
|
-
declare const DialogCloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
|
60
|
-
type DialogHeaderProps = ModalHeaderProps;
|
|
61
|
-
declare const DialogHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
62
|
-
type DialogBodyProps = ModalBodyProps;
|
|
63
|
-
declare const DialogBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
64
|
-
type DialogFooterProps = ModalFooterProps;
|
|
65
|
-
declare const DialogFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
66
52
|
|
|
67
|
-
export { Dialog,
|
|
53
|
+
export { Dialog, type DialogProps };
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
-
import { ThemeProps } from '@yamada-ui/core';
|
|
3
1
|
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
4
2
|
import { ButtonProps } from '@yamada-ui/button';
|
|
5
|
-
import {
|
|
3
|
+
import { ThemeProps } from '@yamada-ui/core';
|
|
6
4
|
import { ReactNode } from 'react';
|
|
7
5
|
import { ModalProps } from './modal.js';
|
|
8
|
-
import { ModalOverlayProps } from './modal-overlay.js';
|
|
9
|
-
import { ModalHeaderProps } from './modal-header.js';
|
|
10
|
-
import { ModalBodyProps } from './modal-body.js';
|
|
11
|
-
import { ModalFooterProps } from './modal-footer.js';
|
|
12
6
|
import '@yamada-ui/focus-lock';
|
|
13
7
|
import '@yamada-ui/portal';
|
|
8
|
+
import './modal-content.js';
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
interface DialogOptions {
|
|
16
11
|
/**
|
|
17
12
|
* The dialog header to use.
|
|
18
13
|
*/
|
|
@@ -45,23 +40,14 @@ type DialogOptions = {
|
|
|
45
40
|
* The callback invoked when success button clicked.
|
|
46
41
|
*/
|
|
47
42
|
onSuccess?: (onClose: (() => void) | undefined) => void;
|
|
48
|
-
}
|
|
49
|
-
|
|
43
|
+
}
|
|
44
|
+
interface DialogProps extends Omit<ModalProps, keyof ThemeProps>, ThemeProps<"Dialog">, DialogOptions {
|
|
45
|
+
}
|
|
50
46
|
/**
|
|
51
47
|
* `Dialog` is a component used to confirm or interrupt user actions.
|
|
52
48
|
*
|
|
53
49
|
* @see Docs https://yamada-ui.com/components/overlay/dialog
|
|
54
50
|
*/
|
|
55
51
|
declare const Dialog: _yamada_ui_motion.MotionComponent<"section", DialogProps>;
|
|
56
|
-
type DialogOverlayProps = ModalOverlayProps;
|
|
57
|
-
declare const DialogOverlay: _yamada_ui_motion.MotionComponent<"div", ModalOverlayProps>;
|
|
58
|
-
type DialogCloseButtonProps = CloseButtonProps;
|
|
59
|
-
declare const DialogCloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
|
60
|
-
type DialogHeaderProps = ModalHeaderProps;
|
|
61
|
-
declare const DialogHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
62
|
-
type DialogBodyProps = ModalBodyProps;
|
|
63
|
-
declare const DialogBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
64
|
-
type DialogFooterProps = ModalFooterProps;
|
|
65
|
-
declare const DialogFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
66
52
|
|
|
67
|
-
export { Dialog,
|
|
53
|
+
export { Dialog, type DialogProps };
|