@yamada-ui/modal 1.3.13-dev-20241016065058 → 1.4.0-dev-20241016150325
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-ZVXKXIPM.mjs → chunk-26L5MSTF.mjs} +5 -5
- package/dist/{chunk-G7R3GU24.mjs → chunk-4L4JX6MZ.mjs} +3 -3
- package/dist/{chunk-6XAWCUQQ.mjs → chunk-4MSKF3NP.mjs} +3 -3
- package/dist/{chunk-VB44U6WY.mjs → chunk-4VGCDKI3.mjs} +3 -2
- package/dist/chunk-4VGCDKI3.mjs.map +1 -0
- package/dist/{chunk-7THNENCM.mjs → chunk-6VCJW6AO.mjs} +8 -8
- package/dist/{chunk-7I5LX3VI.mjs → chunk-AQ6NOJ35.mjs} +12 -8
- package/dist/chunk-AQ6NOJ35.mjs.map +1 -0
- package/dist/{chunk-37MTMX5B.mjs → chunk-CBL7CH2A.mjs} +3 -3
- package/dist/{chunk-EDCPPJBS.mjs → chunk-CTBGRQX2.mjs} +3 -3
- package/dist/{chunk-TXXRGDQR.mjs → chunk-DH735WKL.mjs} +3 -3
- package/dist/{chunk-PDW7A62B.mjs → chunk-DT5IIM35.mjs} +3 -2
- package/dist/chunk-DT5IIM35.mjs.map +1 -0
- package/dist/{chunk-LYMMHCHF.mjs → chunk-DWQHOEUG.mjs} +4 -3
- package/dist/chunk-DWQHOEUG.mjs.map +1 -0
- package/dist/{chunk-OAECULYV.mjs → chunk-E4FDNJ4R.mjs} +2 -2
- package/dist/{chunk-VMTMWWII.mjs → chunk-EITLQG4B.mjs} +3 -3
- package/dist/{chunk-A7WOQJCA.mjs → chunk-EPC5EUXN.mjs} +1 -1
- package/dist/chunk-EPC5EUXN.mjs.map +1 -0
- package/dist/{chunk-ZDEVCYYC.mjs → chunk-GBZ3BEXX.mjs} +4 -3
- package/dist/chunk-GBZ3BEXX.mjs.map +1 -0
- package/dist/{chunk-P5SCGBP7.mjs → chunk-JZEVC6JC.mjs} +9 -5
- package/dist/chunk-JZEVC6JC.mjs.map +1 -0
- package/dist/{chunk-BNRFPNWF.mjs → chunk-O6TYHALA.mjs} +3 -3
- package/dist/{chunk-7EVREJIH.mjs → chunk-SCU75AQJ.mjs} +8 -4
- package/dist/chunk-SCU75AQJ.mjs.map +1 -0
- package/dist/{chunk-LUSTM3GA.mjs → chunk-U2DBPI7Y.mjs} +4 -3
- package/dist/{chunk-LUSTM3GA.mjs.map → chunk-U2DBPI7Y.mjs.map} +1 -1
- package/dist/{chunk-VNQHFTL2.mjs → chunk-UWNNN2FG.mjs} +3 -3
- package/dist/{chunk-L353QQ6S.mjs → chunk-X5STF2Y7.mjs} +2 -2
- package/dist/{chunk-W7WF42SC.mjs → chunk-Z7MBETMY.mjs} +3 -3
- package/dist/dialog-body.js +2 -1
- package/dist/dialog-body.js.map +1 -1
- package/dist/dialog-body.mjs +3 -3
- package/dist/dialog-close-button.js +2 -0
- package/dist/dialog-close-button.js.map +1 -1
- package/dist/dialog-close-button.mjs +3 -3
- package/dist/dialog-footer.js.map +1 -1
- package/dist/dialog-footer.mjs +3 -3
- package/dist/dialog-header.js +2 -1
- package/dist/dialog-header.js.map +1 -1
- package/dist/dialog-header.mjs +3 -3
- package/dist/dialog-overlay.js +1 -0
- package/dist/dialog-overlay.js.map +1 -1
- package/dist/dialog-overlay.mjs +3 -3
- package/dist/dialog.js +20 -3
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +18 -18
- package/dist/drawer-body.js +2 -1
- package/dist/drawer-body.js.map +1 -1
- package/dist/drawer-body.mjs +3 -3
- package/dist/drawer-close-button.js +1 -0
- package/dist/drawer-close-button.js.map +1 -1
- package/dist/drawer-close-button.mjs +3 -3
- package/dist/drawer-content.js +6 -1
- 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.map +1 -1
- package/dist/drawer-footer.mjs +3 -3
- package/dist/drawer-header.js +2 -1
- package/dist/drawer-header.js.map +1 -1
- package/dist/drawer-header.mjs +3 -3
- package/dist/drawer-overlay.js +1 -0
- package/dist/drawer-overlay.js.map +1 -1
- package/dist/drawer-overlay.mjs +3 -3
- package/dist/drawer.js +16 -1
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +12 -12
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/modal-body.js +2 -1
- package/dist/modal-body.js.map +1 -1
- package/dist/modal-body.mjs +2 -2
- package/dist/modal-close-button.js +1 -0
- package/dist/modal-close-button.js.map +1 -1
- package/dist/modal-close-button.mjs +2 -2
- package/dist/modal-content.js +6 -0
- package/dist/modal-content.js.map +1 -1
- package/dist/modal-content.mjs +4 -4
- package/dist/modal-context.d.mts +2 -0
- package/dist/modal-context.d.ts +2 -0
- package/dist/modal-context.js.map +1 -1
- package/dist/modal-context.mjs +1 -1
- package/dist/modal-footer.js.map +1 -1
- package/dist/modal-footer.mjs +2 -2
- package/dist/modal-header.js +2 -1
- package/dist/modal-header.js.map +1 -1
- package/dist/modal-header.mjs +2 -2
- package/dist/modal-overlay.js +1 -0
- package/dist/modal-overlay.js.map +1 -1
- package/dist/modal-overlay.mjs +2 -2
- package/dist/modal.js +16 -1
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +11 -11
- package/package.json +7 -7
- package/dist/chunk-7EVREJIH.mjs.map +0 -1
- package/dist/chunk-7I5LX3VI.mjs.map +0 -1
- package/dist/chunk-A7WOQJCA.mjs.map +0 -1
- package/dist/chunk-LYMMHCHF.mjs.map +0 -1
- package/dist/chunk-P5SCGBP7.mjs.map +0 -1
- package/dist/chunk-PDW7A62B.mjs.map +0 -1
- package/dist/chunk-VB44U6WY.mjs.map +0 -1
- package/dist/chunk-ZDEVCYYC.mjs.map +0 -1
- /package/dist/{chunk-ZVXKXIPM.mjs.map → chunk-26L5MSTF.mjs.map} +0 -0
- /package/dist/{chunk-G7R3GU24.mjs.map → chunk-4L4JX6MZ.mjs.map} +0 -0
- /package/dist/{chunk-6XAWCUQQ.mjs.map → chunk-4MSKF3NP.mjs.map} +0 -0
- /package/dist/{chunk-7THNENCM.mjs.map → chunk-6VCJW6AO.mjs.map} +0 -0
- /package/dist/{chunk-37MTMX5B.mjs.map → chunk-CBL7CH2A.mjs.map} +0 -0
- /package/dist/{chunk-EDCPPJBS.mjs.map → chunk-CTBGRQX2.mjs.map} +0 -0
- /package/dist/{chunk-TXXRGDQR.mjs.map → chunk-DH735WKL.mjs.map} +0 -0
- /package/dist/{chunk-OAECULYV.mjs.map → chunk-E4FDNJ4R.mjs.map} +0 -0
- /package/dist/{chunk-VMTMWWII.mjs.map → chunk-EITLQG4B.mjs.map} +0 -0
- /package/dist/{chunk-BNRFPNWF.mjs.map → chunk-O6TYHALA.mjs.map} +0 -0
- /package/dist/{chunk-VNQHFTL2.mjs.map → chunk-UWNNN2FG.mjs.map} +0 -0
- /package/dist/{chunk-L353QQ6S.mjs.map → chunk-X5STF2Y7.mjs.map} +0 -0
- /package/dist/{chunk-W7WF42SC.mjs.map → chunk-Z7MBETMY.mjs.map} +0 -0
@@ -1,16 +1,16 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
Modal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-AQ6NOJ35.mjs";
|
5
5
|
import {
|
6
6
|
DrawerContent
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-JZEVC6JC.mjs";
|
8
8
|
import {
|
9
9
|
DrawerOverlay
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-4L4JX6MZ.mjs";
|
11
11
|
import {
|
12
12
|
DrawerProvider
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-EPC5EUXN.mjs";
|
14
14
|
|
15
15
|
// src/drawer.tsx
|
16
16
|
import { omitThemeProps, useComponentMultiStyle } from "@yamada-ui/core";
|
@@ -115,4 +115,4 @@ Drawer.__ui__ = "Drawer";
|
|
115
115
|
export {
|
116
116
|
Drawer
|
117
117
|
};
|
118
|
-
//# sourceMappingURL=chunk-
|
118
|
+
//# sourceMappingURL=chunk-26L5MSTF.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalOverlay
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-4VGCDKI3.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.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-4L4JX6MZ.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalBody
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-GBZ3BEXX.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.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-4MSKF3NP.mjs.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useModal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-EPC5EUXN.mjs";
|
5
5
|
|
6
6
|
// src/modal-overlay.tsx
|
7
7
|
import { motion, motionForwardRef } from "@yamada-ui/motion";
|
@@ -32,6 +32,7 @@ var ModalOverlay = motionForwardRef(
|
|
32
32
|
{
|
33
33
|
ref,
|
34
34
|
className: cx("ui-modal__overlay", className),
|
35
|
+
"aria-hidden": true,
|
35
36
|
custom: { duration },
|
36
37
|
onClick: handlerAll(onClick, onOverlayClick, (ev) => {
|
37
38
|
ev.stopPropagation();
|
@@ -50,4 +51,4 @@ ModalOverlay.__ui__ = "ModalOverlay";
|
|
50
51
|
export {
|
51
52
|
ModalOverlay
|
52
53
|
};
|
53
|
-
//# sourceMappingURL=chunk-
|
54
|
+
//# sourceMappingURL=chunk-4VGCDKI3.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal-overlay.tsx"],"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 aria-hidden\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"],"mappings":";;;;;;AAEA,SAAS,QAAQ,wBAAwB;AACzC,SAAS,iBAAiB;AAC1B,SAAS,IAAI,kBAAkB;AA4BzB;AAvBC,IAAM,eAAe;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,YAAY,CAAC;AAElD,WACE;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,eAAW;AAAA,QACX,QAAQ,EAAE,SAAS;AAAA,QACnB,SAAS,WAAW,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":[]}
|
@@ -1,25 +1,25 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
Modal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-AQ6NOJ35.mjs";
|
5
5
|
import {
|
6
6
|
DialogBody
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EITLQG4B.mjs";
|
8
8
|
import {
|
9
9
|
DialogCloseButton
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-U2DBPI7Y.mjs";
|
11
11
|
import {
|
12
12
|
DialogFooter
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-Z7MBETMY.mjs";
|
14
14
|
import {
|
15
15
|
DialogHeader
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-CBL7CH2A.mjs";
|
17
17
|
import {
|
18
18
|
DialogOverlay
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-CTBGRQX2.mjs";
|
20
20
|
import {
|
21
21
|
DialogProvider
|
22
|
-
} from "./chunk-
|
22
|
+
} from "./chunk-EPC5EUXN.mjs";
|
23
23
|
|
24
24
|
// src/dialog.tsx
|
25
25
|
import { Button } from "@yamada-ui/button";
|
@@ -138,4 +138,4 @@ Dialog.__ui__ = "Dialog";
|
|
138
138
|
export {
|
139
139
|
Dialog
|
140
140
|
};
|
141
|
-
//# sourceMappingURL=chunk-
|
141
|
+
//# sourceMappingURL=chunk-6VCJW6AO.mjs.map
|
@@ -1,22 +1,22 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalContent
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-SCU75AQJ.mjs";
|
5
5
|
import {
|
6
6
|
DrawerContent
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-JZEVC6JC.mjs";
|
8
8
|
import {
|
9
9
|
DrawerOverlay
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-4L4JX6MZ.mjs";
|
11
11
|
import {
|
12
12
|
DialogOverlay
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-CTBGRQX2.mjs";
|
14
14
|
import {
|
15
15
|
ModalOverlay
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-4VGCDKI3.mjs";
|
17
17
|
import {
|
18
18
|
ModalProvider
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-EPC5EUXN.mjs";
|
20
20
|
|
21
21
|
// src/modal.tsx
|
22
22
|
import { omitThemeProps, ui, useComponentMultiStyle } from "@yamada-ui/core";
|
@@ -25,7 +25,7 @@ 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
27
|
import { findChild, findChildren, getValidChildren } from "@yamada-ui/utils";
|
28
|
-
import { cloneElement, useCallback } from "react";
|
28
|
+
import { cloneElement, useCallback, useId } from "react";
|
29
29
|
import { RemoveScroll } from "react-remove-scroll";
|
30
30
|
import { jsx, jsxs } from "react/jsx-runtime";
|
31
31
|
var Modal = motionForwardRef(
|
@@ -62,6 +62,8 @@ var Modal = motionForwardRef(
|
|
62
62
|
onOverlayClick,
|
63
63
|
...rest
|
64
64
|
} = omitThemeProps(mergedProps);
|
65
|
+
const labelledbyId = useId();
|
66
|
+
const describedbyId = useId();
|
65
67
|
const onKeyDown = useCallback(
|
66
68
|
(ev) => {
|
67
69
|
if (ev.key !== "Escape") return;
|
@@ -100,8 +102,10 @@ var Modal = motionForwardRef(
|
|
100
102
|
value: {
|
101
103
|
animation,
|
102
104
|
closeOnOverlay,
|
105
|
+
describedbyId,
|
103
106
|
duration,
|
104
107
|
isOpen,
|
108
|
+
labelledbyId,
|
105
109
|
scrollBehavior,
|
106
110
|
styles,
|
107
111
|
withCloseButton,
|
@@ -147,4 +151,4 @@ var Modal = motionForwardRef(
|
|
147
151
|
export {
|
148
152
|
Modal
|
149
153
|
};
|
150
|
-
//# sourceMappingURL=chunk-
|
154
|
+
//# sourceMappingURL=chunk-AQ6NOJ35.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, useId } 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 const labelledbyId = useId()\n const describedbyId = useId()\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 describedbyId,\n duration,\n isOpen,\n labelledbyId,\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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
|
2
2
|
import {
|
3
3
|
ModalHeader
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-DWQHOEUG.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.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-CBL7CH2A.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalOverlay
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-4VGCDKI3.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.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-CTBGRQX2.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalFooter
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-X5STF2Y7.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.mjs";
|
8
8
|
|
9
9
|
// src/drawer-footer.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -31,4 +31,4 @@ DrawerFooter.__ui__ = "DrawerFooter";
|
|
31
31
|
export {
|
32
32
|
DrawerFooter
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-DH735WKL.mjs.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useModal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-EPC5EUXN.mjs";
|
5
5
|
|
6
6
|
// src/modal-close-button.tsx
|
7
7
|
import { CloseButton } from "@yamada-ui/close-button";
|
@@ -20,6 +20,7 @@ var ModalCloseButton = forwardRef(
|
|
20
20
|
{
|
21
21
|
ref,
|
22
22
|
className: cx("ui-modal__close-button"),
|
23
|
+
"aria-label": "Close modal",
|
23
24
|
onClick: handlerAll(onClick, (ev) => {
|
24
25
|
ev.stopPropagation();
|
25
26
|
onClose == null ? void 0 : onClose();
|
@@ -36,4 +37,4 @@ ModalCloseButton.__ui__ = "ModalCloseButton";
|
|
36
37
|
export {
|
37
38
|
ModalCloseButton
|
38
39
|
};
|
39
|
-
//# sourceMappingURL=chunk-
|
40
|
+
//# sourceMappingURL=chunk-DT5IIM35.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal-close-button.tsx"],"sourcesContent":["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 aria-label=\"Close modal\"\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"],"mappings":";;;;;;AAEA,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,IAAI,kBAAkB;AAezB;AAVC,IAAM,mBAAmB;AAAA,EAC9B,CAAC,EAAE,SAAS,OAAO,GAAG,KAAK,GAAG,QAAQ;AACpC,UAAM,EAAE,QAAQ,QAAQ,IAAI,SAAS;AAErC,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,wBAAwB;AAAA,QACtC,cAAW;AAAA,QACX,SAAS,WAAW,SAAS,CAAC,OAAO;AACnC,aAAG,gBAAgB;AACnB;AAAA,QACF,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAC/B,iBAAiB,SAAS;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useModal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-EPC5EUXN.mjs";
|
5
5
|
|
6
6
|
// src/modal-header.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -9,7 +9,7 @@ import { cx } from "@yamada-ui/utils";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
10
10
|
var ModalHeader = forwardRef(
|
11
11
|
({ className, __css, ...rest }, ref) => {
|
12
|
-
const { styles } = useModal();
|
12
|
+
const { labelledbyId, styles } = useModal();
|
13
13
|
const css = {
|
14
14
|
alignItems: "center",
|
15
15
|
display: "flex",
|
@@ -19,6 +19,7 @@ var ModalHeader = forwardRef(
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
20
20
|
ui.header,
|
21
21
|
{
|
22
|
+
id: labelledbyId,
|
22
23
|
ref,
|
23
24
|
className: cx("ui-modal__header", className),
|
24
25
|
__css: css,
|
@@ -33,4 +34,4 @@ ModalHeader.__ui__ = "ModalHeader";
|
|
33
34
|
export {
|
34
35
|
ModalHeader
|
35
36
|
};
|
36
|
-
//# sourceMappingURL=chunk-
|
37
|
+
//# sourceMappingURL=chunk-DWQHOEUG.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal-header.tsx"],"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 { labelledbyId, 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 id={labelledbyId}\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"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAiBb;AAZC,IAAM,cAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,cAAc,OAAO,IAAI,SAAS;AAE1C,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,IAAI;AAAA,QACJ;AAAA,QACA,WAAW,GAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAC1B,YAAY,SAAS;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useDrawer
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-EPC5EUXN.mjs";
|
5
5
|
|
6
6
|
// src/drawer-drag-bar.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -28,4 +28,4 @@ DrawerDragBar.__ui__ = "DrawerDragBar";
|
|
28
28
|
export {
|
29
29
|
DrawerDragBar
|
30
30
|
};
|
31
|
-
//# sourceMappingURL=chunk-
|
31
|
+
//# sourceMappingURL=chunk-E4FDNJ4R.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalBody
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-GBZ3BEXX.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.mjs";
|
8
8
|
|
9
9
|
// src/dialog-body.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -31,4 +31,4 @@ DialogBody.__ui__ = "DialogBody";
|
|
31
31
|
export {
|
32
32
|
DialogBody
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
34
|
+
//# sourceMappingURL=chunk-EITLQG4B.mjs.map
|
@@ -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 describedbyId: string\n labelledbyId: string\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;AAQvB,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,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useModal
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-EPC5EUXN.mjs";
|
5
5
|
|
6
6
|
// src/modal-body.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -9,7 +9,7 @@ import { cx } from "@yamada-ui/utils";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
10
10
|
var ModalBody = forwardRef(
|
11
11
|
({ className, __css, ...rest }, ref) => {
|
12
|
-
const { scrollBehavior, styles } = useModal();
|
12
|
+
const { describedbyId, scrollBehavior, styles } = useModal();
|
13
13
|
const css = {
|
14
14
|
alignItems: "flex-start",
|
15
15
|
display: "flex",
|
@@ -20,6 +20,7 @@ var ModalBody = forwardRef(
|
|
20
20
|
return /* @__PURE__ */ jsx(
|
21
21
|
ui.div,
|
22
22
|
{
|
23
|
+
id: describedbyId,
|
23
24
|
ref,
|
24
25
|
className: cx("ui-modal__body", className),
|
25
26
|
__css: css,
|
@@ -34,4 +35,4 @@ ModalBody.__ui__ = "ModalBody";
|
|
34
35
|
export {
|
35
36
|
ModalBody
|
36
37
|
};
|
37
|
-
//# sourceMappingURL=chunk-
|
38
|
+
//# sourceMappingURL=chunk-GBZ3BEXX.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/modal-body.tsx"],"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 ModalBodyProps extends HTMLUIProps {}\n\nexport const ModalBody = forwardRef<ModalBodyProps, \"div\">(\n ({ className, __css, ...rest }, ref) => {\n const { describedbyId, scrollBehavior, styles } = useModal()\n\n const css: CSSUIObject = {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: scrollBehavior === \"inside\" ? \"auto\" : undefined,\n ...(__css ? __css : styles.body),\n }\n\n return (\n <ui.div\n id={describedbyId}\n ref={ref}\n className={cx(\"ui-modal__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalBody.displayName = \"ModalBody\"\nModalBody.__ui__ = \"ModalBody\"\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAkBb;AAbC,IAAM,YAAY;AAAA,EACvB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,eAAe,gBAAgB,OAAO,IAAI,SAAS;AAE3D,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,eAAe;AAAA,MACf,UAAU,mBAAmB,WAAW,SAAS;AAAA,MACjD,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,IAAI;AAAA,QACJ;AAAA,QACA,WAAW,GAAG,kBAAkB,SAAS;AAAA,QACzC,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;AACxB,UAAU,SAAS;","names":[]}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DrawerDragBar
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-E4FDNJ4R.mjs";
|
5
5
|
import {
|
6
6
|
DrawerCloseButton
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-UWNNN2FG.mjs";
|
8
8
|
import {
|
9
9
|
useDrawer,
|
10
10
|
useModal
|
11
|
-
} from "./chunk-
|
11
|
+
} from "./chunk-EPC5EUXN.mjs";
|
12
12
|
|
13
13
|
// src/drawer-content.tsx
|
14
14
|
import { ui } from "@yamada-ui/core";
|
@@ -33,7 +33,7 @@ var DrawerContent = motionForwardRef(
|
|
33
33
|
blankForDragProps,
|
34
34
|
...rest
|
35
35
|
}, ref) => {
|
36
|
-
const { duration, isOpen, onClose } = useModal();
|
36
|
+
const { describedbyId, duration, isOpen, labelledbyId, onClose } = useModal();
|
37
37
|
const styles = useDrawer();
|
38
38
|
const placement = useValue(_placement);
|
39
39
|
const validChildren = getValidChildren(children);
|
@@ -138,6 +138,9 @@ var DrawerContent = motionForwardRef(
|
|
138
138
|
{
|
139
139
|
ref,
|
140
140
|
className: cx("ui-drawer", className),
|
141
|
+
"aria-describedby": describedbyId,
|
142
|
+
"aria-labelledby": labelledbyId,
|
143
|
+
"aria-modal": "true",
|
141
144
|
drag: closeOnDrag ? getDragDirection() : false,
|
142
145
|
dragConstraints: getDragDirectionRestriction(dragConstraints),
|
143
146
|
dragElastic: getDragDirectionRestriction(dragElastic),
|
@@ -146,6 +149,7 @@ var DrawerContent = motionForwardRef(
|
|
146
149
|
duration,
|
147
150
|
isOpen,
|
148
151
|
placement,
|
152
|
+
role: "dialog",
|
149
153
|
tabIndex: -1,
|
150
154
|
onDragEnd: (_, info) => {
|
151
155
|
if (isCloseByDragInfo(info)) onClose == null ? void 0 : onClose();
|
@@ -180,4 +184,4 @@ DrawerContent.__ui__ = "DrawerContent";
|
|
180
184
|
export {
|
181
185
|
DrawerContent
|
182
186
|
};
|
183
|
-
//# sourceMappingURL=chunk-
|
187
|
+
//# sourceMappingURL=chunk-JZEVC6JC.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/drawer-content.tsx"],"sourcesContent":["import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionPanInfo } from \"@yamada-ui/motion\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { DrawerProps } from \"./drawer\"\nimport { ui } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { Slide } from \"@yamada-ui/transitions\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, findChildren, getValidChildren, isArray } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { DrawerCloseButton } from \"./drawer-close-button\"\nimport { DrawerDragBar } from \"./drawer-drag-bar\"\nimport { useDrawer, useModal } from \"./modal-context\"\n\nexport interface DrawerContentProps\n extends Merge<\n Omit<DrawerProps, \"isOpen\" | \"placement\" | keyof ThemeProps>,\n Required<\n Pick<\n DrawerProps,\n | \"dragConstraints\"\n | \"dragElastic\"\n | \"dragOffset\"\n | \"dragVelocity\"\n | \"placement\"\n | \"placement\"\n >\n >\n > {}\n\nexport const DrawerContent = motionForwardRef<DrawerContentProps, \"div\">(\n (\n {\n className,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement: _placement,\n withCloseButton,\n withDragBar,\n blankForDragProps,\n ...rest\n },\n ref,\n ) => {\n const { describedbyId, duration, isOpen, labelledbyId, onClose } =\n useModal()\n const styles = useDrawer()\n const placement = useValue(_placement)\n\n const validChildren = getValidChildren(children)\n\n const [customDrawerCloseButton, ...cloneChildren] = findChildren(\n validChildren,\n DrawerCloseButton,\n )\n\n const blankForDragBg = useMemo(() => {\n const propBg =\n rest.backgroundColor ?? rest.bgColor ?? rest.background ?? rest.bg\n const styleBg =\n styles.container?.backgroundColor ??\n styles.container?.bgColor ??\n styles.container?.background ??\n styles.container?.bg\n const computedBg = propBg ?? styleBg\n\n return isArray(computedBg) ? computedBg : [computedBg]\n }, [rest, styles])\n\n const blankForDrag = useMemo<CSSUIObject>(() => {\n let position: CSSUIObject = {}\n\n switch (placement) {\n case \"top\":\n position = { left: 0, right: 0, top: \"calc(-100dvh + 1px)\" }\n break\n\n case \"bottom\":\n position = { bottom: \"calc(-100dvh + 1px)\", left: 0, right: 0 }\n break\n\n case \"left\":\n position = { bottom: 0, left: \"calc(-100% + 1px)\", top: 0 }\n break\n\n case \"right\":\n position = { bottom: 0, right: \"calc(-100% + 1px)\", top: 0 }\n break\n }\n\n const [lightBg, darkBg] = blankForDragBg\n\n return {\n _after: {\n bg: lightBg,\n content: '\"\"',\n display: \"block\",\n h: \"100dvh\",\n position: \"absolute\",\n w: \"100%\",\n ...position,\n ...blankForDragProps,\n },\n _dark: {\n _after: {\n bg: darkBg,\n },\n },\n }\n }, [placement, blankForDragBg, blankForDragProps])\n\n const css = useMemo<CSSUIObject>(\n () => ({\n display: \"flex\",\n flexDirection:\n placement === \"top\" || placement === \"bottom\" ? \"column\" : \"row\",\n outline: 0,\n ...(closeOnDrag ? blankForDrag : {}),\n ...styles.container,\n }),\n [blankForDrag, closeOnDrag, placement, styles],\n )\n\n const getDragDirectionRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"top\":\n return { bottom: value }\n case \"bottom\":\n return { top: value }\n case \"left\":\n return { right: value }\n case \"right\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const getDragDirection = useCallback(() => {\n switch (placement) {\n case \"top\":\n case \"bottom\":\n return \"y\"\n case \"left\":\n case \"right\":\n return \"x\"\n }\n }, [placement])\n\n const isCloseByDragInfo = useCallback(\n (info: MotionPanInfo) => {\n switch (placement) {\n case \"top\":\n return (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n case \"bottom\":\n return (\n info.velocity.y >= dragVelocity || info.offset.y >= dragOffset\n )\n case \"left\":\n return (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n case \"right\":\n return (\n info.velocity.x >= dragVelocity || info.offset.x >= dragOffset\n )\n }\n },\n [placement, dragVelocity, dragOffset],\n )\n\n return (\n <Slide\n ref={ref}\n className={cx(\"ui-drawer\", className)}\n aria-describedby={describedbyId}\n aria-labelledby={labelledbyId}\n aria-modal=\"true\"\n drag={closeOnDrag ? getDragDirection() : false}\n dragConstraints={getDragDirectionRestriction(dragConstraints)}\n dragElastic={getDragDirectionRestriction(dragElastic)}\n dragMomentum={false}\n dragSnapToOrigin\n duration={duration}\n isOpen={isOpen}\n placement={placement}\n role=\"dialog\"\n tabIndex={-1}\n onDragEnd={(_, info) => {\n if (isCloseByDragInfo(info)) onClose?.()\n }}\n __css={css}\n {...rest}\n >\n {customDrawerCloseButton ??\n (withCloseButton && onClose ? <DrawerCloseButton /> : null)}\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"bottom\" || placement === \"right\") ? (\n <DrawerDragBar />\n ) : null}\n\n <ui.div\n className=\"ui-drawer__inner\"\n __css={{\n display: \"flex\",\n flexDirection: \"column\",\n w: \"100%\",\n ...styles.inner,\n }}\n >\n {cloneChildren}\n </ui.div>\n\n {withDragBar &&\n closeOnDrag &&\n (placement === \"top\" || placement === \"left\") ? (\n <DrawerDragBar />\n ) : null}\n </Slide>\n )\n },\n)\n\nDrawerContent.displayName = \"DrawerContent\"\nDrawerContent.__ui__ = \"DrawerContent\"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,GAAG;AAAA,gBACH,GAAG,OAAO;AAAA,cACZ;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UAEC,eACD,gBACC,cAAc,SAAS,cAAc,UACpC,oBAAC,iBAAc,IACb;AAAA;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
|
ModalHeader
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-DWQHOEUG.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.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-O6TYHALA.mjs.map
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogCloseButton
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-U2DBPI7Y.mjs";
|
5
5
|
import {
|
6
6
|
ModalCloseButton
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-DT5IIM35.mjs";
|
8
8
|
import {
|
9
9
|
useModal
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-EPC5EUXN.mjs";
|
11
11
|
|
12
12
|
// src/modal-content.tsx
|
13
13
|
import { motion, motionForwardRef } from "@yamada-ui/motion";
|
@@ -47,7 +47,9 @@ var ModalContent = motionForwardRef(
|
|
47
47
|
({ className, children, __css, ...rest }, ref) => {
|
48
48
|
const {
|
49
49
|
animation,
|
50
|
+
describedbyId,
|
50
51
|
duration,
|
52
|
+
labelledbyId,
|
51
53
|
scrollBehavior,
|
52
54
|
styles,
|
53
55
|
withCloseButton,
|
@@ -74,6 +76,8 @@ var ModalContent = motionForwardRef(
|
|
74
76
|
{
|
75
77
|
ref,
|
76
78
|
className: cx("ui-modal", className),
|
79
|
+
"aria-describedby": describedbyId,
|
80
|
+
"aria-labelledby": labelledbyId,
|
77
81
|
"aria-modal": "true",
|
78
82
|
role: "dialog",
|
79
83
|
tabIndex: -1,
|
@@ -94,4 +98,4 @@ ModalContent.__ui__ = "ModalContent";
|
|
94
98
|
export {
|
95
99
|
ModalContent
|
96
100
|
};
|
97
|
-
//# sourceMappingURL=chunk-
|
101
|
+
//# sourceMappingURL=chunk-SCU75AQJ.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 describedbyId,\n duration,\n labelledbyId,\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-describedby={describedbyId}\n aria-labelledby={labelledbyId}\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;AAgF7C,SAakC,KAblC;AA3EN,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,UA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ACE,mBAAmB,UAAU,oBAAC,oBAAiB,IAAK;AAAA,UAEtD;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":[]}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalCloseButton
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-DT5IIM35.mjs";
|
5
5
|
import {
|
6
6
|
useDialog
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-EPC5EUXN.mjs";
|
8
8
|
|
9
9
|
// src/dialog-close-button.tsx
|
10
10
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -19,6 +19,7 @@ var DialogCloseButton = forwardRef(
|
|
19
19
|
{
|
20
20
|
ref,
|
21
21
|
className: cx("ui-dialog__close-button", className),
|
22
|
+
"aria-label": "Close dialog",
|
22
23
|
__css: css,
|
23
24
|
...rest
|
24
25
|
}
|
@@ -31,4 +32,4 @@ DialogCloseButton.__ui__ = "DialogCloseButton";
|
|
31
32
|
export {
|
32
33
|
DialogCloseButton
|
33
34
|
};
|
34
|
-
//# sourceMappingURL=chunk-
|
35
|
+
//# sourceMappingURL=chunk-U2DBPI7Y.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-close-button.tsx"],"sourcesContent":["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"],"mappings":";;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAab;AAPC,IAAM,oBAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,YAAY;AAEjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,2BAA2B,SAAS;AAAA,QAClD,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;","names":[]}
|
1
|
+
{"version":3,"sources":["../src/dialog-close-button.tsx"],"sourcesContent":["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 aria-label=\"Close dialog\"\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogCloseButton.displayName = \"DialogCloseButton\"\nDialogCloseButton.__ui__ = \"DialogCloseButton\"\n"],"mappings":";;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AAab;AAPC,IAAM,oBAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,YAAY;AAEjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,2BAA2B,SAAS;AAAA,QAClD,cAAW;AAAA,QACX,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;","names":[]}
|