@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
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalHeader
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LYMMHCHF.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-A7WOQJCA.mjs";
|
8
8
|
|
9
9
|
// src/dialog-header.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -31,4 +31,4 @@ DialogHeader.__ui__ = "DialogHeader";
|
|
31
31
|
export {
|
32
32
|
DialogHeader
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-37MTMX5B.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/dialog-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalHeaderProps } from \"./modal-header\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\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\nDialogHeader.displayName = \"DialogHeader\"\nDialogHeader.__ui__ = \"DialogHeader\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAab;AAPC,IAAM,eAAe;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,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":[]}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalBody
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-ZDEVCYYC.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-A7WOQJCA.mjs";
|
8
8
|
|
9
9
|
// src/drawer-body.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -31,4 +31,4 @@ DrawerBody.__ui__ = "DrawerBody";
|
|
31
31
|
export {
|
32
32
|
DrawerBody
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-6XAWCUQQ.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/drawer-body.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/drawer-body.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalBodyProps } from \"./modal-body\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ModalBody } from \"./modal-body\"\nimport { useDrawer } from \"./modal-context\"\n\nexport interface DrawerBodyProps extends ModalBodyProps {}\n\nexport const DrawerBody = forwardRef<DrawerBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.body }\n\n return (\n <ModalBody\n ref={ref}\n className={cx(\"ui-drawer__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerBody.displayName = \"DrawerBody\"\nDrawerBody.__ui__ = \"DrawerBody\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAab;AAPC,IAAM,aAAa;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,KAAK;AAE1C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AACzB,WAAW,SAAS;","names":[]}
|
@@ -1,57 +1,57 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogCloseButton
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LUSTM3GA.mjs";
|
5
5
|
import {
|
6
6
|
ModalCloseButton
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-PDW7A62B.mjs";
|
8
8
|
import {
|
9
9
|
useModal
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-A7WOQJCA.mjs";
|
11
11
|
|
12
12
|
// src/modal-content.tsx
|
13
13
|
import { motion, motionForwardRef } from "@yamada-ui/motion";
|
14
14
|
import { scaleFadeProps, slideFadeProps } from "@yamada-ui/transitions";
|
15
|
-
import { cx,
|
15
|
+
import { cx, findChildren, getValidChildren } from "@yamada-ui/utils";
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
17
17
|
var getModalContentProps = (animation = "scale", duration) => {
|
18
18
|
switch (animation) {
|
19
19
|
case "scale":
|
20
20
|
return {
|
21
21
|
...scaleFadeProps,
|
22
|
-
custom: {
|
22
|
+
custom: { duration, reverse: true, scale: 0.95 }
|
23
23
|
};
|
24
24
|
case "top":
|
25
25
|
return {
|
26
26
|
...slideFadeProps,
|
27
|
-
custom: { offsetY: -16, reverse: true
|
27
|
+
custom: { duration, offsetY: -16, reverse: true }
|
28
28
|
};
|
29
29
|
case "right":
|
30
30
|
return {
|
31
31
|
...slideFadeProps,
|
32
|
-
custom: { offsetX: 16, reverse: true
|
32
|
+
custom: { duration, offsetX: 16, reverse: true }
|
33
33
|
};
|
34
34
|
case "left":
|
35
35
|
return {
|
36
36
|
...slideFadeProps,
|
37
|
-
custom: { offsetX: -16, reverse: true
|
37
|
+
custom: { duration, offsetX: -16, reverse: true }
|
38
38
|
};
|
39
39
|
case "bottom":
|
40
40
|
return {
|
41
41
|
...slideFadeProps,
|
42
|
-
custom: { offsetY: 16, reverse: true
|
42
|
+
custom: { duration, offsetY: 16, reverse: true }
|
43
43
|
};
|
44
44
|
}
|
45
45
|
};
|
46
46
|
var ModalContent = motionForwardRef(
|
47
47
|
({ className, children, __css, ...rest }, ref) => {
|
48
48
|
const {
|
49
|
-
|
49
|
+
animation,
|
50
|
+
duration,
|
50
51
|
scrollBehavior,
|
52
|
+
styles,
|
51
53
|
withCloseButton,
|
52
|
-
onClose
|
53
|
-
animation,
|
54
|
-
duration
|
54
|
+
onClose
|
55
55
|
} = useModal();
|
56
56
|
const validChildren = getValidChildren(children);
|
57
57
|
const [customModalCloseButton, ...cloneChildren] = findChildren(
|
@@ -61,21 +61,21 @@ var ModalContent = motionForwardRef(
|
|
61
61
|
);
|
62
62
|
const props = animation !== "none" ? getModalContentProps(animation, duration) : {};
|
63
63
|
const css = {
|
64
|
-
position: "relative",
|
65
|
-
maxH: "100%",
|
66
64
|
display: "flex",
|
67
65
|
flexDirection: "column",
|
68
|
-
|
66
|
+
maxH: "100%",
|
69
67
|
outline: 0,
|
68
|
+
overflow: scrollBehavior === "inside" ? "hidden" : "auto",
|
69
|
+
position: "relative",
|
70
70
|
...__css ? __css : styles.container
|
71
71
|
};
|
72
72
|
return /* @__PURE__ */ jsxs(
|
73
73
|
motion.section,
|
74
74
|
{
|
75
|
-
role: "dialog",
|
76
|
-
"aria-modal": "true",
|
77
75
|
ref,
|
78
76
|
className: cx("ui-modal", className),
|
77
|
+
"aria-modal": "true",
|
78
|
+
role: "dialog",
|
79
79
|
tabIndex: -1,
|
80
80
|
__css: css,
|
81
81
|
...props,
|
@@ -94,4 +94,4 @@ ModalContent.__ui__ = "ModalContent";
|
|
94
94
|
export {
|
95
95
|
ModalContent
|
96
96
|
};
|
97
|
-
//# sourceMappingURL=chunk-
|
97
|
+
//# sourceMappingURL=chunk-7EVREJIH.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal-content.tsx"],"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"],"mappings":";;;;;;;;;;;;AAIA,SAAS,QAAQ,wBAAwB;AACzC,SAAS,gBAAgB,sBAAsB;AAC/C,SAAS,IAAI,cAAc,wBAAwB;AA8E7C,SAWkC,KAXlC;AAzEN,IAAM,uBAAuB,CAC3B,YAAqC,SACrC,aACG;AACH,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,EAAE,UAAU,SAAS,MAAM,OAAO,KAAK;AAAA,MACjD;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,EAAE,UAAU,SAAS,KAAK,SAAS,KAAK;AAAA,MAClD;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,EAAE,UAAU,SAAS,IAAI,SAAS,KAAK;AAAA,MACjD;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,EAAE,UAAU,SAAS,KAAK,SAAS,KAAK;AAAA,MAClD;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,EAAE,UAAU,SAAS,IAAI,SAAS,KAAK;AAAA,MACjD;AAAA,EACJ;AACF;AASO,IAAM,eAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,GAAG,QAAQ;AAChD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,SAAS;AAEb,UAAM,gBAAgB,iBAAiB,QAAQ;AAE/C,UAAM,CAAC,wBAAwB,GAAG,aAAa,IAAI;AAAA,MACjD;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,UAAM,QACJ,cAAc,SAAS,qBAAqB,WAAW,QAAQ,IAAI,CAAC;AAEtE,UAAM,MAAmB;AAAA,MACvB,SAAS;AAAA,MACT,eAAe;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU,mBAAmB,WAAW,WAAW;AAAA,MACnD,UAAU;AAAA,MACV,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,WAAW,GAAG,YAAY,SAAS;AAAA,QACnC,cAAW;AAAA,QACX,MAAK;AAAA,QACL,UAAU;AAAA,QACV,OAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,oEACE,mBAAmB,UAAU,oBAAC,oBAAiB,IAAK;AAAA,UAEtD;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":[]}
|
@@ -1,30 +1,30 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalContent
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-7EVREJIH.mjs";
|
5
5
|
import {
|
6
6
|
DrawerContent
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-P5SCGBP7.mjs";
|
8
8
|
import {
|
9
9
|
DrawerOverlay
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-G7R3GU24.mjs";
|
11
11
|
import {
|
12
12
|
DialogOverlay
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-EDCPPJBS.mjs";
|
14
14
|
import {
|
15
15
|
ModalOverlay
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-VB44U6WY.mjs";
|
17
17
|
import {
|
18
18
|
ModalProvider
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-A7WOQJCA.mjs";
|
20
20
|
|
21
21
|
// src/modal.tsx
|
22
|
-
import {
|
22
|
+
import { omitThemeProps, ui, useComponentMultiStyle } from "@yamada-ui/core";
|
23
23
|
import { FocusLock } from "@yamada-ui/focus-lock";
|
24
24
|
import { AnimatePresence, motionForwardRef } from "@yamada-ui/motion";
|
25
25
|
import { Portal } from "@yamada-ui/portal";
|
26
26
|
import { useValue } from "@yamada-ui/use-value";
|
27
|
-
import {
|
27
|
+
import { findChild, findChildren, getValidChildren } from "@yamada-ui/utils";
|
28
28
|
import { cloneElement, useCallback } from "react";
|
29
29
|
import { RemoveScroll } from "react-remove-scroll";
|
30
30
|
import { jsx, jsxs } from "react/jsx-runtime";
|
@@ -36,30 +36,30 @@ var Modal = motionForwardRef(
|
|
36
36
|
});
|
37
37
|
const {
|
38
38
|
className,
|
39
|
-
children,
|
40
|
-
isOpen,
|
41
|
-
onClose,
|
42
|
-
onOverlayClick,
|
43
|
-
onEsc,
|
44
|
-
onCloseComplete,
|
45
|
-
placement: _placement = "center",
|
46
|
-
outside = "fallback(4, 1rem)",
|
47
|
-
withCloseButton = true,
|
48
|
-
withOverlay = true,
|
49
39
|
allowPinchZoom = false,
|
50
|
-
|
40
|
+
animation = "scale",
|
51
41
|
autoFocus,
|
52
|
-
restoreFocus,
|
53
|
-
initialFocusRef,
|
54
|
-
finalFocusRef,
|
55
42
|
blockScrollOnMount = true,
|
56
|
-
|
43
|
+
children,
|
57
44
|
closeOnEsc = true,
|
58
|
-
|
59
|
-
animation = "scale",
|
45
|
+
closeOnOverlay = true,
|
60
46
|
duration,
|
61
|
-
|
47
|
+
finalFocusRef,
|
48
|
+
initialFocusRef,
|
49
|
+
isOpen,
|
50
|
+
lockFocusAcrossFrames = true,
|
51
|
+
outside = "fallback(4, 1rem)",
|
52
|
+
placement: _placement = "center",
|
53
|
+
restoreFocus,
|
54
|
+
scrollBehavior = "inside",
|
55
|
+
withCloseButton = true,
|
56
|
+
withOverlay = true,
|
62
57
|
containerProps,
|
58
|
+
portalProps,
|
59
|
+
onClose,
|
60
|
+
onCloseComplete,
|
61
|
+
onEsc,
|
62
|
+
onOverlayClick,
|
63
63
|
...rest
|
64
64
|
} = omitThemeProps(mergedProps);
|
65
65
|
const onKeyDown = useCallback(
|
@@ -83,39 +83,39 @@ var Modal = motionForwardRef(
|
|
83
83
|
drawerContent = cloneElement(drawerContent, { onKeyDown });
|
84
84
|
const placement = useValue(_placement);
|
85
85
|
const css = {
|
86
|
+
alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center",
|
87
|
+
display: "flex",
|
88
|
+
h: "100dvh",
|
89
|
+
justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
|
90
|
+
left: 0,
|
91
|
+
p: size !== "full" ? outside : void 0,
|
86
92
|
position: "fixed",
|
87
93
|
top: 0,
|
88
|
-
left: 0,
|
89
|
-
zIndex: "fallback(jeice, 110)",
|
90
94
|
w: "100vw",
|
91
|
-
|
92
|
-
p: size !== "full" ? outside : void 0,
|
93
|
-
display: "flex",
|
94
|
-
justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
|
95
|
-
alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center"
|
95
|
+
zIndex: "fallback(jeice, 110)"
|
96
96
|
};
|
97
97
|
return /* @__PURE__ */ jsx(
|
98
98
|
ModalProvider,
|
99
99
|
{
|
100
100
|
value: {
|
101
|
-
isOpen,
|
102
|
-
onClose,
|
103
|
-
onOverlayClick,
|
104
|
-
withCloseButton,
|
105
|
-
scrollBehavior,
|
106
|
-
closeOnOverlay,
|
107
101
|
animation,
|
102
|
+
closeOnOverlay,
|
108
103
|
duration,
|
109
|
-
|
104
|
+
isOpen,
|
105
|
+
scrollBehavior,
|
106
|
+
styles,
|
107
|
+
withCloseButton,
|
108
|
+
onClose,
|
109
|
+
onOverlayClick
|
110
110
|
},
|
111
111
|
children: /* @__PURE__ */ jsx(AnimatePresence, { onExitComplete: onCloseComplete, children: isOpen ? /* @__PURE__ */ jsx(Portal, { ...portalProps, children: /* @__PURE__ */ jsx(
|
112
112
|
FocusLock,
|
113
113
|
{
|
114
114
|
autoFocus,
|
115
|
-
initialFocusRef,
|
116
115
|
finalFocusRef,
|
117
|
-
|
116
|
+
initialFocusRef,
|
118
117
|
lockFocusAcrossFrames,
|
118
|
+
restoreFocus,
|
119
119
|
children: /* @__PURE__ */ jsx(
|
120
120
|
RemoveScroll,
|
121
121
|
{
|
@@ -147,4 +147,4 @@ var Modal = motionForwardRef(
|
|
147
147
|
export {
|
148
148
|
Modal
|
149
149
|
};
|
150
|
-
//# sourceMappingURL=chunk-
|
150
|
+
//# sourceMappingURL=chunk-7I5LX3VI.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n Token,\n} from \"@yamada-ui/core\"\nimport type { FocusLockProps } from \"@yamada-ui/focus-lock\"\nimport type { MotionTransitionProps } from \"@yamada-ui/motion\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type { KeyboardEvent } from \"react\"\nimport type { ModalContentProps } from \"./modal-content\"\nimport { omitThemeProps, ui, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { FocusLock } from \"@yamada-ui/focus-lock\"\nimport { AnimatePresence, motionForwardRef } from \"@yamada-ui/motion\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { findChild, findChildren, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement, useCallback } from \"react\"\nimport { RemoveScroll } from \"react-remove-scroll\"\nimport { DialogOverlay } from \"./dialog-overlay\"\nimport { DrawerContent } from \"./drawer-content\"\nimport { DrawerOverlay } from \"./drawer-overlay\"\nimport { ModalContent } from \"./modal-content\"\nimport { ModalProvider } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface ModalOptions\n extends Pick<\n FocusLockProps,\n | \"autoFocus\"\n | \"finalFocusRef\"\n | \"initialFocusRef\"\n | \"lockFocusAcrossFrames\"\n | \"restoreFocus\"\n > {\n /**\n * If `true`, the open will be opened.\n */\n isOpen: boolean\n /**\n * Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.\n *\n * @default false.\n */\n allowPinchZoom?: boolean\n /**\n * The animation of the tooltip.\n *\n * @default 'scale'\n */\n animation?: \"bottom\" | \"left\" | \"none\" | \"right\" | \"scale\" | \"top\"\n /**\n * If `true`, scrolling will be disabled on the `body` when the modal opens.\n *\n * @default true\n */\n blockScrollOnMount?: boolean\n /**\n * If `true`, the modal will close when the `Esc` key is pressed.\n *\n * @default true\n */\n closeOnEsc?: boolean\n /**\n * If `true`, the modal will close when the overlay is clicked.\n *\n * @default true\n */\n closeOnOverlay?: boolean\n /**\n * The animation duration.\n */\n duration?: MotionTransitionProps[\"duration\"]\n /**\n * The CSS `padding` property.\n */\n outside?: CSSUIProps[\"p\"]\n /**\n * The placement of the modal.\n *\n * @default 'center'\n */\n placement?: Token<\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"center\"\n | \"left\"\n | \"right\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n >\n /**\n * Where scroll behavior should originate.\n *\n * - `inside`: scroll only occurs within the `ModalBody`.\n * - `outside`: the entire `ModalContent` will scroll within the viewport.\n *\n * @default 'inside'\n */\n scrollBehavior?: \"inside\" | \"outside\"\n /**\n * If `true`, display the modal close button.\n *\n * @default true\n */\n withCloseButton?: boolean\n /**\n * If `true`, display the modal overlay.\n *\n * @default true\n */\n withOverlay?: boolean\n /**\n * Props for modal container element.\n */\n containerProps?: HTMLUIProps\n /**\n * Props to be forwarded to the portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Callback invoked to close the modal.\n */\n onClose?: () => void\n /**\n * Callback function to run side effects after the modal has closed.\n */\n onCloseComplete?: () => void\n /**\n * Callback fired when the escape key is pressed and focus is within modal.\n */\n onEsc?(): void\n /**\n * Callback fired when the overlay is clicked.\n */\n onOverlayClick?: () => void\n}\n\nexport interface ModalProps\n extends ModalContentProps,\n ThemeProps<\"Modal\">,\n ModalOptions {}\n\n/**\n * `Modal` is a component that is displayed over the main content to focus the user's attention solely on the information.\n *\n * @see Docs https://yamada-ui.com/components/overlay/modal\n */\nexport const Modal = motionForwardRef<ModalProps, \"section\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Modal\", {\n size,\n ...props,\n })\n const {\n className,\n allowPinchZoom = false,\n animation = \"scale\",\n autoFocus,\n blockScrollOnMount = true,\n children,\n closeOnEsc = true,\n closeOnOverlay = true,\n duration,\n finalFocusRef,\n initialFocusRef,\n isOpen,\n lockFocusAcrossFrames = true,\n outside = \"fallback(4, 1rem)\",\n placement: _placement = \"center\",\n restoreFocus,\n scrollBehavior = \"inside\",\n withCloseButton = true,\n withOverlay = true,\n containerProps,\n portalProps,\n onClose,\n onCloseComplete,\n onEsc,\n onOverlayClick,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent) => {\n if (ev.key !== \"Escape\") return\n\n ev.stopPropagation()\n\n if (closeOnEsc) onClose?.()\n\n onEsc?.()\n },\n [closeOnEsc, onClose, onEsc],\n )\n\n const validChildren = getValidChildren(children)\n\n const [customModalOverlay, ...cloneChildren] = findChildren(\n validChildren,\n ModalOverlay,\n DialogOverlay,\n DrawerOverlay,\n )\n\n let drawerContent = findChild(validChildren, DrawerContent)\n\n if (drawerContent)\n drawerContent = cloneElement(drawerContent, { onKeyDown })\n\n const placement = useValue(_placement)\n\n const css: CSSUIObject = {\n alignItems: placement.includes(\"top\")\n ? \"flex-start\"\n : placement.includes(\"bottom\")\n ? \"flex-end\"\n : \"center\",\n display: \"flex\",\n h: \"100dvh\",\n justifyContent: placement.includes(\"left\")\n ? \"flex-start\"\n : placement.includes(\"right\")\n ? \"flex-end\"\n : \"center\",\n left: 0,\n p: size !== \"full\" ? outside : undefined,\n position: \"fixed\",\n top: 0,\n w: \"100vw\",\n zIndex: \"fallback(jeice, 110)\",\n }\n\n return (\n <ModalProvider\n value={{\n animation,\n closeOnOverlay,\n duration,\n isOpen,\n scrollBehavior,\n styles,\n withCloseButton,\n onClose,\n onOverlayClick,\n }}\n >\n <AnimatePresence onExitComplete={onCloseComplete}>\n {isOpen ? (\n <Portal {...portalProps}>\n <FocusLock\n autoFocus={autoFocus}\n finalFocusRef={finalFocusRef}\n initialFocusRef={initialFocusRef}\n lockFocusAcrossFrames={lockFocusAcrossFrames}\n restoreFocus={restoreFocus}\n >\n <RemoveScroll\n allowPinchZoom={allowPinchZoom}\n enabled={blockScrollOnMount}\n forwardProps\n >\n <ui.div __css={css} {...containerProps}>\n {customModalOverlay ??\n (withOverlay && size !== \"full\" ? (\n <ModalOverlay />\n ) : null)}\n\n {drawerContent ?? (\n <ModalContent\n ref={ref}\n className={className}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {cloneChildren}\n </ModalContent>\n )}\n </ui.div>\n </RemoveScroll>\n </FocusLock>\n </Portal>\n ) : null}\n </AnimatePresence>\n </ModalProvider>\n )\n },\n)\n"],"mappings":"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","names":[]}
|
@@ -1,37 +1,38 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
Modal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-7I5LX3VI.mjs";
|
5
5
|
import {
|
6
6
|
DialogBody
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-VMTMWWII.mjs";
|
8
8
|
import {
|
9
9
|
DialogCloseButton
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-LUSTM3GA.mjs";
|
11
11
|
import {
|
12
12
|
DialogFooter
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-W7WF42SC.mjs";
|
14
14
|
import {
|
15
15
|
DialogHeader
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-37MTMX5B.mjs";
|
17
17
|
import {
|
18
18
|
DialogOverlay
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-EDCPPJBS.mjs";
|
20
20
|
import {
|
21
21
|
DialogProvider
|
22
|
-
} from "./chunk-
|
22
|
+
} from "./chunk-A7WOQJCA.mjs";
|
23
23
|
|
24
24
|
// src/dialog.tsx
|
25
25
|
import { Button } from "@yamada-ui/button";
|
26
|
-
import {
|
26
|
+
import { omitThemeProps, useComponentMultiStyle } from "@yamada-ui/core";
|
27
27
|
import { motionForwardRef } from "@yamada-ui/motion";
|
28
28
|
import {
|
29
|
+
cx,
|
30
|
+
findChild,
|
29
31
|
getValidChildren,
|
30
|
-
omitChildren,
|
31
|
-
isValidElement,
|
32
32
|
isEmpty,
|
33
|
-
|
34
|
-
|
33
|
+
isUndefined,
|
34
|
+
isValidElement,
|
35
|
+
omitChildren
|
35
36
|
} from "@yamada-ui/utils";
|
36
37
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
37
38
|
var Dialog = motionForwardRef(
|
@@ -42,19 +43,19 @@ var Dialog = motionForwardRef(
|
|
42
43
|
});
|
43
44
|
const {
|
44
45
|
className,
|
46
|
+
cancel,
|
45
47
|
children,
|
46
|
-
withOverlay = true,
|
47
|
-
withCloseButton = true,
|
48
|
-
header,
|
49
48
|
footer,
|
50
|
-
|
49
|
+
header,
|
51
50
|
other,
|
52
51
|
success,
|
53
|
-
|
52
|
+
withCloseButton = true,
|
53
|
+
withOverlay = true,
|
54
|
+
containerProps,
|
54
55
|
onCancel,
|
56
|
+
onClose,
|
55
57
|
onOther,
|
56
58
|
onSuccess,
|
57
|
-
containerProps,
|
58
59
|
...rest
|
59
60
|
} = omitThemeProps(mergedProps);
|
60
61
|
const validChildren = getValidChildren(children);
|
@@ -72,15 +73,18 @@ var Dialog = motionForwardRef(
|
|
72
73
|
DialogFooter
|
73
74
|
) : children;
|
74
75
|
const css = { ...styles.container };
|
75
|
-
const cancelButtonProps = isValidElement(cancel) ? { children: cancel } : cancel;
|
76
|
-
const otherButtonProps = isValidElement(other) ? { children: other } : other;
|
77
|
-
const successButtonProps = isValidElement(success) ? { children: success } : success;
|
78
|
-
if (cancelButtonProps
|
79
|
-
|
80
|
-
if (otherButtonProps && !otherButtonProps.colorScheme)
|
76
|
+
const cancelButtonProps = isValidElement(cancel) || isUndefined(cancel) ? { children: cancel } : cancel;
|
77
|
+
const otherButtonProps = isValidElement(other) || isUndefined(other) ? { children: other } : other;
|
78
|
+
const successButtonProps = isValidElement(success) || isUndefined(success) ? { children: success } : success;
|
79
|
+
if (!cancelButtonProps.variant) cancelButtonProps.variant = "ghost";
|
80
|
+
if (!otherButtonProps.colorScheme)
|
81
81
|
otherButtonProps.colorScheme = "secondary";
|
82
|
-
if (
|
82
|
+
if (!successButtonProps.colorScheme)
|
83
83
|
successButtonProps.colorScheme = "primary";
|
84
|
+
const hasCancelButton = !!cancelButtonProps.children;
|
85
|
+
const hasOtherButton = !!otherButtonProps.children;
|
86
|
+
const hasSuccessButton = !!successButtonProps.children;
|
87
|
+
const hasFooter = hasCancelButton || hasOtherButton || hasSuccessButton;
|
84
88
|
return /* @__PURE__ */ jsx(DialogProvider, { value: styles, children: /* @__PURE__ */ jsxs(
|
85
89
|
Modal,
|
86
90
|
{
|
@@ -88,10 +92,10 @@ var Dialog = motionForwardRef(
|
|
88
92
|
className: cx("ui-dialog", className),
|
89
93
|
__css: css,
|
90
94
|
...{
|
91
|
-
onClose,
|
92
|
-
withOverlay: false,
|
93
95
|
withCloseButton: false,
|
96
|
+
withOverlay: false,
|
94
97
|
containerProps,
|
98
|
+
onClose,
|
95
99
|
...rest,
|
96
100
|
size
|
97
101
|
},
|
@@ -100,22 +104,22 @@ var Dialog = motionForwardRef(
|
|
100
104
|
customDialogCloseButton != null ? customDialogCloseButton : withCloseButton && onClose ? /* @__PURE__ */ jsx(DialogCloseButton, {}) : null,
|
101
105
|
customDialogHeader != null ? customDialogHeader : header ? /* @__PURE__ */ jsx(DialogHeader, { children: header }) : null,
|
102
106
|
customDialogBody != null ? customDialogBody : cloneChildren ? /* @__PURE__ */ jsx(DialogBody, { children: cloneChildren }) : null,
|
103
|
-
customDialogFooter != null ? customDialogFooter : footer ||
|
104
|
-
|
107
|
+
customDialogFooter != null ? customDialogFooter : footer || hasFooter ? /* @__PURE__ */ jsx(DialogFooter, { children: footer != null ? footer : /* @__PURE__ */ jsxs(Fragment, { children: [
|
108
|
+
hasCancelButton ? /* @__PURE__ */ jsx(
|
105
109
|
Button,
|
106
110
|
{
|
107
111
|
onClick: () => onCancel == null ? void 0 : onCancel(onClose),
|
108
112
|
...cancelButtonProps
|
109
113
|
}
|
110
114
|
) : null,
|
111
|
-
|
115
|
+
hasOtherButton ? /* @__PURE__ */ jsx(
|
112
116
|
Button,
|
113
117
|
{
|
114
118
|
onClick: () => onOther == null ? void 0 : onOther(onClose),
|
115
119
|
...otherButtonProps
|
116
120
|
}
|
117
121
|
) : null,
|
118
|
-
|
122
|
+
hasSuccessButton ? /* @__PURE__ */ jsx(
|
119
123
|
Button,
|
120
124
|
{
|
121
125
|
onClick: () => onSuccess == null ? void 0 : onSuccess(onClose),
|
@@ -134,4 +138,4 @@ Dialog.__ui__ = "Dialog";
|
|
134
138
|
export {
|
135
139
|
Dialog
|
136
140
|
};
|
137
|
-
//# sourceMappingURL=chunk-
|
141
|
+
//# sourceMappingURL=chunk-7THNENCM.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/dialog.tsx"],"sourcesContent":["import type { ButtonProps } from \"@yamada-ui/button\"\nimport type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { ReactNode } from \"react\"\nimport type { ModalProps } from \"./modal\"\nimport { Button } from \"@yamada-ui/button\"\nimport { omitThemeProps, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport {\n cx,\n findChild,\n getValidChildren,\n isEmpty,\n isUndefined,\n isValidElement,\n omitChildren,\n} from \"@yamada-ui/utils\"\nimport { DialogBody } from \"./dialog-body\"\nimport { DialogCloseButton } from \"./dialog-close-button\"\nimport { DialogFooter } from \"./dialog-footer\"\nimport { DialogHeader } from \"./dialog-header\"\nimport { DialogOverlay } from \"./dialog-overlay\"\nimport { Modal } from \"./modal\"\nimport { DialogProvider } from \"./modal-context\"\n\ninterface DialogOptions {\n /**\n * The dialog cancel to use.\n */\n cancel?: ButtonProps | ReactNode\n /**\n * The dialog footer to use.\n */\n footer?: ReactNode\n /**\n * The dialog header to use.\n */\n header?: ReactNode\n /**\n * The dialog other to use.\n */\n other?: ButtonProps | ReactNode\n /**\n * The dialog success to use.\n */\n success?: ButtonProps | ReactNode\n /**\n * The callback invoked when cancel button clicked.\n */\n onCancel?: (onClose: (() => void) | undefined) => void\n /**\n * The callback invoked when other button clicked.\n */\n onOther?: (onClose: (() => void) | undefined) => void\n /**\n * The callback invoked when success button clicked.\n */\n onSuccess?: (onClose: (() => void) | undefined) => void\n}\n\nexport interface DialogProps\n extends Omit<ModalProps, keyof ThemeProps>,\n ThemeProps<\"Dialog\">,\n DialogOptions {}\n\n/**\n * `Dialog` is a component used to confirm or interrupt user actions.\n *\n * @see Docs https://yamada-ui.com/components/overlay/dialog\n */\nexport const Dialog = motionForwardRef<DialogProps, \"section\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Dialog\", {\n size,\n ...props,\n })\n const {\n className,\n cancel,\n children,\n footer,\n header,\n other,\n success,\n withCloseButton = true,\n withOverlay = true,\n containerProps,\n onCancel,\n onClose,\n onOther,\n onSuccess,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const validChildren = getValidChildren(children)\n\n const customDialogOverlay = findChild(validChildren, DialogOverlay)\n const customDialogCloseButton = findChild(validChildren, DialogCloseButton)\n const customDialogHeader = findChild(validChildren, DialogHeader)\n const customDialogBody = findChild(validChildren, DialogBody)\n const customDialogFooter = findChild(validChildren, DialogFooter)\n\n const cloneChildren = !isEmpty(validChildren)\n ? omitChildren(\n validChildren,\n DialogOverlay,\n DialogCloseButton,\n DialogHeader,\n DialogBody,\n DialogFooter,\n )\n : children\n\n const css: CSSUIObject = { ...styles.container }\n\n const cancelButtonProps: ButtonProps =\n isValidElement(cancel) || isUndefined(cancel)\n ? { children: cancel }\n : cancel\n const otherButtonProps: ButtonProps =\n isValidElement(other) || isUndefined(other) ? { children: other } : other\n const successButtonProps: ButtonProps =\n isValidElement(success) || isUndefined(success)\n ? { children: success }\n : success\n\n if (!cancelButtonProps.variant) cancelButtonProps.variant = \"ghost\"\n if (!otherButtonProps.colorScheme)\n otherButtonProps.colorScheme = \"secondary\"\n if (!successButtonProps.colorScheme)\n successButtonProps.colorScheme = \"primary\"\n\n const hasCancelButton = !!cancelButtonProps.children\n const hasOtherButton = !!otherButtonProps.children\n const hasSuccessButton = !!successButtonProps.children\n const hasFooter = hasCancelButton || hasOtherButton || hasSuccessButton\n\n return (\n <DialogProvider value={styles}>\n <Modal\n ref={ref}\n className={cx(\"ui-dialog\", className)}\n __css={css}\n {...{\n withCloseButton: false,\n withOverlay: false,\n containerProps,\n onClose,\n ...rest,\n size,\n }}\n >\n {customDialogOverlay ??\n (withOverlay && size !== \"full\" ? <DialogOverlay /> : null)}\n {customDialogCloseButton ??\n (withCloseButton && onClose ? <DialogCloseButton /> : null)}\n {customDialogHeader ??\n (header ? <DialogHeader>{header}</DialogHeader> : null)}\n {customDialogBody ??\n (cloneChildren ? <DialogBody>{cloneChildren}</DialogBody> : null)}\n {customDialogFooter ??\n (footer || hasFooter ? (\n <DialogFooter>\n {footer ?? (\n <>\n {hasCancelButton ? (\n <Button\n onClick={() => onCancel?.(onClose)}\n {...cancelButtonProps}\n />\n ) : null}\n {hasOtherButton ? (\n <Button\n onClick={() => onOther?.(onClose)}\n {...otherButtonProps}\n />\n ) : null}\n {hasSuccessButton ? (\n <Button\n onClick={() => onSuccess?.(onClose)}\n {...successButtonProps}\n />\n ) : null}\n </>\n )}\n </DialogFooter>\n ) : null)}\n </Modal>\n </DialogProvider>\n )\n },\n)\n\nDialog.displayName = \"Dialog\"\nDialog.__ui__ = \"Dialog\"\n"],"mappings":"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","names":[]}
|
@@ -0,0 +1 @@
|
|
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":";;;AAEA,SAAS,qBAAqB;AAMvB,IAAM,CAAC,eAAe,QAAQ,IAAI,cAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,IAAI,cAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,IAAI,cAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalHeader
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LYMMHCHF.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-A7WOQJCA.mjs";
|
8
8
|
|
9
9
|
// src/drawer-header.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -31,4 +31,4 @@ DrawerHeader.__ui__ = "DrawerHeader";
|
|
31
31
|
export {
|
32
32
|
DrawerHeader
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-BNRFPNWF.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/drawer-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/drawer-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalHeaderProps } from \"./modal-header\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport { ModalHeader } from \"./modal-header\"\n\nexport interface DrawerHeaderProps extends ModalHeaderProps {}\n\nexport const DrawerHeader = forwardRef<DrawerHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.header }\n\n return (\n <ModalHeader\n ref={ref}\n className={cx(\"ui-drawer__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerHeader.displayName = \"DrawerHeader\"\nDrawerHeader.__ui__ = \"DrawerHeader\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAab;AAPC,IAAM,eAAe;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,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":[]}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalOverlay
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-VB44U6WY.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-A7WOQJCA.mjs";
|
8
8
|
|
9
9
|
// src/dialog-overlay.tsx
|
10
10
|
import { motionForwardRef } from "@yamada-ui/motion";
|
@@ -31,4 +31,4 @@ DialogOverlay.__ui__ = "DialogOverlay";
|
|
31
31
|
export {
|
32
32
|
DialogOverlay
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-EDCPPJBS.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/dialog-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalOverlay } 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\nDialogOverlay.displayName = \"DialogOverlay\"\nDialogOverlay.__ui__ = \"DialogOverlay\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,wBAAwB;AACjC,SAAS,UAAU;AAab;AAPC,IAAM,gBAAgB;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,WAAW,GAAG,sBAAsB,SAAS;AAAA,QAC7C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAC5B,cAAc,SAAS;","names":[]}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalOverlay
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-VB44U6WY.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-A7WOQJCA.mjs";
|
8
8
|
|
9
9
|
// src/drawer-overlay.tsx
|
10
10
|
import { motionForwardRef } from "@yamada-ui/motion";
|
@@ -31,4 +31,4 @@ DrawerOverlay.__ui__ = "DrawerOverlay";
|
|
31
31
|
export {
|
32
32
|
DrawerOverlay
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-G7R3GU24.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/drawer-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport {
|
1
|
+
{"version":3,"sources":["../src/drawer-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport { ModalOverlay } from \"./modal-overlay\"\n\nexport interface DrawerOverlayProps extends ModalOverlayProps {}\n\nexport const DrawerOverlay = motionForwardRef<DrawerOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const styles = useDrawer()\n\n const css: CSSUIObject = { ...styles.overlay }\n\n return (\n <ModalOverlay\n ref={ref}\n className={cx(\"ui-drawer__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDrawerOverlay.displayName = \"DrawerOverlay\"\nDrawerOverlay.__ui__ = \"DrawerOverlay\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,wBAAwB;AACjC,SAAS,UAAU;AAab;AAPC,IAAM,gBAAgB;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,WAAW,GAAG,sBAAsB,SAAS;AAAA,QAC7C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAC5B,cAAc,SAAS;","names":[]}
|