@yamada-ui/modal 1.4.5-dev-20241116143410 → 1.4.5-dev-20241117115416
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-U2DBPI7Y.mjs → chunk-3RGLB7UM.mjs} +3 -3
- package/dist/{chunk-E4FDNJ4R.mjs → chunk-5NLJNYIN.mjs} +2 -2
- package/dist/{chunk-EPC5EUXN.mjs → chunk-64A25YOZ.mjs} +1 -1
- package/dist/chunk-64A25YOZ.mjs.map +1 -0
- package/dist/{chunk-CBL7CH2A.mjs → chunk-6ZTN6KKG.mjs} +3 -3
- package/dist/{chunk-DWQHOEUG.mjs → chunk-A64FIX7X.mjs} +5 -6
- package/dist/chunk-A64FIX7X.mjs.map +1 -0
- package/dist/{chunk-DH735WKL.mjs → chunk-AVLVLAM5.mjs} +3 -3
- package/dist/{chunk-4SA2BXAV.mjs → chunk-AZF6QW2S.mjs} +10 -9
- package/dist/chunk-AZF6QW2S.mjs.map +1 -0
- package/dist/{chunk-X5STF2Y7.mjs → chunk-F6XJWJIF.mjs} +2 -2
- package/dist/{chunk-SCU75AQJ.mjs → chunk-FXMVCPK5.mjs} +9 -8
- package/dist/chunk-FXMVCPK5.mjs.map +1 -0
- package/dist/{chunk-W4G2GVI7.mjs → chunk-GMWH5UP2.mjs} +8 -8
- package/dist/{chunk-EITLQG4B.mjs → chunk-I7XUEPCF.mjs} +3 -3
- package/dist/{chunk-GBZ3BEXX.mjs → chunk-OPXWQC3M.mjs} +5 -6
- package/dist/chunk-OPXWQC3M.mjs.map +1 -0
- package/dist/{chunk-UWNNN2FG.mjs → chunk-PXCCIW5O.mjs} +3 -3
- package/dist/{chunk-DT5IIM35.mjs → chunk-PXV3LL5A.mjs} +2 -2
- package/dist/{chunk-KRAXUNBU.mjs → chunk-QIRIQ2KT.mjs} +5 -5
- package/dist/{chunk-4MSKF3NP.mjs → chunk-R2TMPSE3.mjs} +3 -3
- package/dist/{chunk-CTBGRQX2.mjs → chunk-V6LGJTK2.mjs} +3 -3
- package/dist/{chunk-4VGCDKI3.mjs → chunk-XDFGVPCC.mjs} +2 -2
- package/dist/{chunk-Z7MBETMY.mjs → chunk-XOD2SYPV.mjs} +3 -3
- package/dist/{chunk-WKDYYNHI.mjs → chunk-YK2YBJMG.mjs} +12 -12
- package/dist/chunk-YK2YBJMG.mjs.map +1 -0
- package/dist/{chunk-O6TYHALA.mjs → chunk-ZG6MHJXG.mjs} +3 -3
- package/dist/{chunk-4L4JX6MZ.mjs → chunk-ZMEZYJLF.mjs} +3 -3
- package/dist/dialog-body.js +2 -3
- package/dist/dialog-body.js.map +1 -1
- package/dist/dialog-body.mjs +3 -3
- 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 -3
- package/dist/dialog-header.js.map +1 -1
- package/dist/dialog-header.mjs +3 -3
- package/dist/dialog-overlay.js.map +1 -1
- package/dist/dialog-overlay.mjs +3 -3
- package/dist/dialog.js +19 -19
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +18 -18
- package/dist/drawer-body.js +2 -3
- package/dist/drawer-body.js.map +1 -1
- package/dist/drawer-body.mjs +3 -3
- package/dist/drawer-close-button.js.map +1 -1
- package/dist/drawer-close-button.mjs +3 -3
- package/dist/drawer-content.js +6 -5
- 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 -3
- package/dist/drawer-header.js.map +1 -1
- package/dist/drawer-header.mjs +3 -3
- package/dist/drawer-overlay.js.map +1 -1
- package/dist/drawer-overlay.mjs +3 -3
- package/dist/drawer.js +15 -13
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +12 -12
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/modal-body.js +2 -3
- package/dist/modal-body.js.map +1 -1
- package/dist/modal-body.mjs +2 -2
- package/dist/modal-close-button.js.map +1 -1
- package/dist/modal-close-button.mjs +2 -2
- package/dist/modal-content.js +5 -4
- package/dist/modal-content.js.map +1 -1
- package/dist/modal-content.mjs +4 -4
- package/dist/modal-context.d.mts +3 -2
- package/dist/modal-context.d.ts +3 -2
- 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 -3
- package/dist/modal-header.js.map +1 -1
- package/dist/modal-header.mjs +2 -2
- package/dist/modal-overlay.js.map +1 -1
- package/dist/modal-overlay.mjs +2 -2
- package/dist/modal.js +15 -13
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +11 -11
- package/package.json +5 -5
- package/dist/chunk-4SA2BXAV.mjs.map +0 -1
- package/dist/chunk-DWQHOEUG.mjs.map +0 -1
- package/dist/chunk-EPC5EUXN.mjs.map +0 -1
- package/dist/chunk-GBZ3BEXX.mjs.map +0 -1
- package/dist/chunk-SCU75AQJ.mjs.map +0 -1
- package/dist/chunk-WKDYYNHI.mjs.map +0 -1
- /package/dist/{chunk-U2DBPI7Y.mjs.map → chunk-3RGLB7UM.mjs.map} +0 -0
- /package/dist/{chunk-E4FDNJ4R.mjs.map → chunk-5NLJNYIN.mjs.map} +0 -0
- /package/dist/{chunk-CBL7CH2A.mjs.map → chunk-6ZTN6KKG.mjs.map} +0 -0
- /package/dist/{chunk-DH735WKL.mjs.map → chunk-AVLVLAM5.mjs.map} +0 -0
- /package/dist/{chunk-X5STF2Y7.mjs.map → chunk-F6XJWJIF.mjs.map} +0 -0
- /package/dist/{chunk-W4G2GVI7.mjs.map → chunk-GMWH5UP2.mjs.map} +0 -0
- /package/dist/{chunk-EITLQG4B.mjs.map → chunk-I7XUEPCF.mjs.map} +0 -0
- /package/dist/{chunk-UWNNN2FG.mjs.map → chunk-PXCCIW5O.mjs.map} +0 -0
- /package/dist/{chunk-DT5IIM35.mjs.map → chunk-PXV3LL5A.mjs.map} +0 -0
- /package/dist/{chunk-KRAXUNBU.mjs.map → chunk-QIRIQ2KT.mjs.map} +0 -0
- /package/dist/{chunk-4MSKF3NP.mjs.map → chunk-R2TMPSE3.mjs.map} +0 -0
- /package/dist/{chunk-CTBGRQX2.mjs.map → chunk-V6LGJTK2.mjs.map} +0 -0
- /package/dist/{chunk-4VGCDKI3.mjs.map → chunk-XDFGVPCC.mjs.map} +0 -0
- /package/dist/{chunk-Z7MBETMY.mjs.map → chunk-XOD2SYPV.mjs.map} +0 -0
- /package/dist/{chunk-O6TYHALA.mjs.map → chunk-ZG6MHJXG.mjs.map} +0 -0
- /package/dist/{chunk-4L4JX6MZ.mjs.map → chunk-ZMEZYJLF.mjs.map} +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
ModalOverlay
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-XDFGVPCC.mjs";
|
5
5
|
import {
|
6
6
|
useDrawer
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-64A25YOZ.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-ZMEZYJLF.mjs.map
|
package/dist/dialog-body.js
CHANGED
@@ -50,7 +50,7 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
50
50
|
var import_jsx_runtime = require("react/jsx-runtime");
|
51
51
|
var ModalBody = (0, import_core.forwardRef)(
|
52
52
|
({ className, __css, ...rest }, ref) => {
|
53
|
-
const {
|
53
|
+
const { bodyRef, scrollBehavior, styles } = useModal();
|
54
54
|
const css = {
|
55
55
|
alignItems: "flex-start",
|
56
56
|
display: "flex",
|
@@ -61,8 +61,7 @@ var ModalBody = (0, import_core.forwardRef)(
|
|
61
61
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
62
62
|
import_core.ui.div,
|
63
63
|
{
|
64
|
-
|
65
|
-
ref,
|
64
|
+
ref: (0, import_utils2.mergeRefs)(bodyRef, ref),
|
66
65
|
className: (0, import_utils2.cx)("ui-modal__body", className),
|
67
66
|
__css: css,
|
68
67
|
...rest
|
package/dist/dialog-body.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-body.tsx","../src/modal-body.tsx","../src/modal-context.ts"],"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 { useDialog } from \"./modal-context\"\n\nexport interface DialogBodyProps extends ModalBodyProps {}\n\nexport const DialogBody = forwardRef<DialogBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.body }\n\n return (\n <ModalBody\n ref={ref}\n className={cx(\"ui-dialog__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogBody.displayName = \"DialogBody\"\nDialogBody.__ui__ = \"DialogBody\"\n","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 {
|
1
|
+
{"version":3,"sources":["../src/dialog-body.tsx","../src/modal-body.tsx","../src/modal-context.ts"],"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 { useDialog } from \"./modal-context\"\n\nexport interface DialogBodyProps extends ModalBodyProps {}\n\nexport const DialogBody = forwardRef<DialogBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.body }\n\n return (\n <ModalBody\n ref={ref}\n className={cx(\"ui-dialog__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogBody.displayName = \"DialogBody\"\nDialogBody.__ui__ = \"DialogBody\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, mergeRefs } 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 { bodyRef, 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 ref={mergeRefs(bodyRef, 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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { RefObject } from \"react\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n bodyRef: RefObject<HTMLElement>\n headerRef: RefObject<HTMLElement>\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACFnB,kBAA+B;AAC/B,IAAAC,gBAA8B;;;ACC9B,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADZK;AAbC,IAAM,gBAAY;AAAA,EACvB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,SAAS,gBAAgB,OAAO,IAAI,SAAS;AAErD,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,eAAG;AAAA,MAAH;AAAA,QACC,SAAK,yBAAU,SAAS,GAAG;AAAA,QAC3B,eAAW,kBAAG,kBAAkB,SAAS;AAAA,QACzC,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;AACxB,UAAU,SAAS;;;ADfb,IAAAC,sBAAA;AAPC,IAAM,iBAAa;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,eAAW,kBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
package/dist/dialog-body.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogBody
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-I7XUEPCF.mjs";
|
5
|
+
import "./chunk-OPXWQC3M.mjs";
|
6
|
+
import "./chunk-64A25YOZ.mjs";
|
7
7
|
export {
|
8
8
|
DialogBody
|
9
9
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts"],"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","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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n
|
1
|
+
{"version":3,"sources":["../src/dialog-close-button.tsx","../src/modal-close-button.tsx","../src/modal-context.ts"],"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","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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { RefObject } from \"react\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n bodyRef: RefObject<HTMLElement>\n headerRef: RefObject<HTMLElement>\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,0BAA4B;AAC5B,kBAA2B;AAC3B,IAAAC,gBAA+B;;;ACD/B,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADbK;AAVC,IAAM,uBAAmB;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,eAAW,kBAAG,wBAAwB;AAAA,QACtC,cAAW;AAAA,QACX,aAAS,0BAAW,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;;;ADnBpB,IAAAC,sBAAA;AAPC,IAAM,wBAAoB;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,eAAW,kBAAG,2BAA2B,SAAS;AAAA,QAClD,cAAW;AAAA,QACX,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogCloseButton
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-3RGLB7UM.mjs";
|
5
|
+
import "./chunk-PXV3LL5A.mjs";
|
6
|
+
import "./chunk-64A25YOZ.mjs";
|
7
7
|
export {
|
8
8
|
DialogCloseButton
|
9
9
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-footer.tsx","../src/modal-context.ts","../src/modal-footer.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalFooterProps } from \"./modal-footer\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalFooter } from \"./modal-footer\"\n\nexport interface DialogFooterProps extends ModalFooterProps {}\n\nexport const DialogFooter = forwardRef<DialogFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.footer }\n\n return (\n <ModalFooter\n ref={ref}\n className={cx(\"ui-dialog__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogFooter.displayName = \"DialogFooter\"\nDialogFooter.__ui__ = \"DialogFooter\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n
|
1
|
+
{"version":3,"sources":["../src/dialog-footer.tsx","../src/modal-context.ts","../src/modal-footer.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalFooterProps } from \"./modal-footer\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDialog } from \"./modal-context\"\nimport { ModalFooter } from \"./modal-footer\"\n\nexport interface DialogFooterProps extends ModalFooterProps {}\n\nexport const DialogFooter = forwardRef<DialogFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useDialog()\n\n const css: CSSUIObject = { ...styles.footer }\n\n return (\n <ModalFooter\n ref={ref}\n className={cx(\"ui-dialog__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nDialogFooter.displayName = \"DialogFooter\"\nDialogFooter.__ui__ = \"DialogFooter\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { RefObject } from \"react\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n bodyRef: RefObject<HTMLElement>\n headerRef: RefObject<HTMLElement>\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","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalFooterProps extends HTMLUIProps<\"footer\"> {}\n\nexport const ModalFooter = forwardRef<ModalFooterProps, \"footer\">(\n ({ className, __css, ...rest }, ref) => {\n const { styles } = useModal()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"flex-end\",\n ...(__css ? __css : styles.footer),\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-modal__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nModalFooter.displayName = \"ModalFooter\"\nModalFooter.__ui__ = \"ModalFooter\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACAnB,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AC/BD,kBAA+B;AAC/B,IAAAC,gBAAmB;AAiBb;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAC1B,YAAY,SAAS;;;AFdf,IAAAC,sBAAA;AAPC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,OAAO;AAE5C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
package/dist/dialog-footer.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogFooter
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-XOD2SYPV.mjs";
|
5
|
+
import "./chunk-F6XJWJIF.mjs";
|
6
|
+
import "./chunk-64A25YOZ.mjs";
|
7
7
|
export {
|
8
8
|
DialogFooter
|
9
9
|
};
|
package/dist/dialog-header.js
CHANGED
@@ -48,7 +48,7 @@ var import_utils2 = require("@yamada-ui/utils");
|
|
48
48
|
var import_jsx_runtime = require("react/jsx-runtime");
|
49
49
|
var ModalHeader = (0, import_core.forwardRef)(
|
50
50
|
({ className, __css, ...rest }, ref) => {
|
51
|
-
const {
|
51
|
+
const { headerRef, styles } = useModal();
|
52
52
|
const css = {
|
53
53
|
alignItems: "center",
|
54
54
|
display: "flex",
|
@@ -58,8 +58,7 @@ var ModalHeader = (0, import_core.forwardRef)(
|
|
58
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
59
59
|
import_core.ui.header,
|
60
60
|
{
|
61
|
-
|
62
|
-
ref,
|
61
|
+
ref: (0, import_utils2.mergeRefs)(headerRef, ref),
|
63
62
|
className: (0, import_utils2.cx)("ui-modal__header", className),
|
64
63
|
__css: css,
|
65
64
|
...rest
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-header.tsx","../src/modal-context.ts","../src/modal-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport 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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n
|
1
|
+
{"version":3,"sources":["../src/dialog-header.tsx","../src/modal-context.ts","../src/modal-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport 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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { RefObject } from \"react\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n bodyRef: RefObject<HTMLElement>\n headerRef: RefObject<HTMLElement>\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","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, mergeRefs } 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 { headerRef, styles } = useModal()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n ...(__css ? __css : styles.header),\n }\n\n return (\n <ui.header\n ref={mergeRefs(headerRef, 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":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACAnB,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AC/BD,kBAA+B;AAC/B,IAAAC,gBAA8B;AAiBxB;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,WAAW,OAAO,IAAI,SAAS;AAEvC,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC,SAAK,yBAAU,WAAW,GAAG;AAAA,QAC7B,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAC1B,YAAY,SAAS;;;AFdf,IAAAC,sBAAA;AAPC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,OAAO;AAE5C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
package/dist/dialog-header.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogHeader
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-6ZTN6KKG.mjs";
|
5
|
+
import "./chunk-A64FIX7X.mjs";
|
6
|
+
import "./chunk-64A25YOZ.mjs";
|
7
7
|
export {
|
8
8
|
DialogHeader
|
9
9
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/dialog-overlay.tsx","../src/modal-context.ts","../src/modal-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport 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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n
|
1
|
+
{"version":3,"sources":["../src/dialog-overlay.tsx","../src/modal-context.ts","../src/modal-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport 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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { RefObject } from \"react\"\nimport type { ModalOptions } from \"./modal\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface ModalContext extends ModalOptions {\n bodyRef: RefObject<HTMLElement>\n headerRef: RefObject<HTMLElement>\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","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":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,iBAAiC;AACjC,IAAAC,gBAAmB;;;ACAnB,mBAA8B;AAQvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AC9BD,oBAAyC;AACzC,yBAA0B;AAC1B,IAAAC,gBAA+B;AA4BzB;AAvBC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,SAAS,OAAO,GAAG,KAAK,GAAG,QAAQ;AAC/C,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,SAAS;AAEb,UAAM,MAAmB;AAAA,MACvB,GAAG;AAAA,MACH,MAAM;AAAA,MACN,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,UAAM,QAAQ,cAAc,SAAS,+BAAY,CAAC;AAElD,WACE;AAAA,MAAC,qBAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,eAAW;AAAA,QACX,QAAQ,EAAE,SAAS;AAAA,QACnB,aAAS,0BAAW,SAAS,gBAAgB,CAAC,OAAO;AACnD,aAAG,gBAAgB;AACnB,cAAI,eAAgB;AAAA,QACtB,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;;;AFlChB,IAAAC,sBAAA;AAPC,IAAM,oBAAgB;AAAA,EAC3B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,QAAQ;AAE7C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,sBAAsB,SAAS;AAAA,QAC7C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAC5B,cAAc,SAAS;","names":["import_motion","import_utils","import_utils","import_jsx_runtime"]}
|
package/dist/dialog-overlay.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
DialogOverlay
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-V6LGJTK2.mjs";
|
5
|
+
import "./chunk-XDFGVPCC.mjs";
|
6
|
+
import "./chunk-64A25YOZ.mjs";
|
7
7
|
export {
|
8
8
|
DialogOverlay
|
9
9
|
};
|
package/dist/dialog.js
CHANGED
@@ -56,7 +56,7 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
56
56
|
var import_jsx_runtime = require("react/jsx-runtime");
|
57
57
|
var ModalBody = (0, import_core.forwardRef)(
|
58
58
|
({ className, __css, ...rest }, ref) => {
|
59
|
-
const {
|
59
|
+
const { bodyRef, scrollBehavior, styles } = useModal();
|
60
60
|
const css = {
|
61
61
|
alignItems: "flex-start",
|
62
62
|
display: "flex",
|
@@ -67,8 +67,7 @@ var ModalBody = (0, import_core.forwardRef)(
|
|
67
67
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
68
68
|
import_core.ui.div,
|
69
69
|
{
|
70
|
-
|
71
|
-
ref,
|
70
|
+
ref: (0, import_utils2.mergeRefs)(bodyRef, ref),
|
72
71
|
className: (0, import_utils2.cx)("ui-modal__body", className),
|
73
72
|
__css: css,
|
74
73
|
...rest
|
@@ -216,7 +215,7 @@ var import_utils8 = require("@yamada-ui/utils");
|
|
216
215
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
217
216
|
var ModalHeader = (0, import_core7.forwardRef)(
|
218
217
|
({ className, __css, ...rest }, ref) => {
|
219
|
-
const {
|
218
|
+
const { headerRef, styles } = useModal();
|
220
219
|
const css = {
|
221
220
|
alignItems: "center",
|
222
221
|
display: "flex",
|
@@ -226,8 +225,7 @@ var ModalHeader = (0, import_core7.forwardRef)(
|
|
226
225
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
227
226
|
import_core7.ui.header,
|
228
227
|
{
|
229
|
-
|
230
|
-
ref,
|
228
|
+
ref: (0, import_utils8.mergeRefs)(headerRef, ref),
|
231
229
|
className: (0, import_utils8.cx)("ui-modal__header", className),
|
232
230
|
__css: css,
|
233
231
|
...rest
|
@@ -406,7 +404,8 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
|
|
406
404
|
blankForDragProps,
|
407
405
|
...rest
|
408
406
|
}, ref) => {
|
409
|
-
|
407
|
+
var _a, _b;
|
408
|
+
let { bodyRef, duration, headerRef, isOpen, open, onClose } = useModal();
|
410
409
|
open != null ? open : open = isOpen;
|
411
410
|
const styles = useDrawer();
|
412
411
|
const placement = (0, import_use_value.useValue)(_placement);
|
@@ -416,8 +415,8 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
|
|
416
415
|
DrawerCloseButton
|
417
416
|
);
|
418
417
|
const blankForDragBg = (0, import_react.useMemo)(() => {
|
419
|
-
var
|
420
|
-
const propBg = (_c = (
|
418
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
419
|
+
const propBg = (_c = (_b2 = (_a2 = rest.backgroundColor) != null ? _a2 : rest.bgColor) != null ? _b2 : rest.background) != null ? _c : rest.bg;
|
421
420
|
const styleBg = (_j = (_h = (_f = (_d = styles.container) == null ? void 0 : _d.backgroundColor) != null ? _f : (_e = styles.container) == null ? void 0 : _e.bgColor) != null ? _h : (_g = styles.container) == null ? void 0 : _g.background) != null ? _j : (_i = styles.container) == null ? void 0 : _i.bg;
|
422
421
|
const computedBg = propBg != null ? propBg : styleBg;
|
423
422
|
return (0, import_utils14.isArray)(computedBg) ? computedBg : [computedBg];
|
@@ -512,8 +511,8 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
|
|
512
511
|
{
|
513
512
|
ref,
|
514
513
|
className: (0, import_utils14.cx)("ui-drawer", className),
|
515
|
-
"aria-describedby":
|
516
|
-
"aria-labelledby":
|
514
|
+
"aria-describedby": (_a = bodyRef.current) == null ? void 0 : _a.id,
|
515
|
+
"aria-labelledby": (_b = headerRef.current) == null ? void 0 : _b.id,
|
517
516
|
"aria-modal": "true",
|
518
517
|
drag: closeOnDrag ? getDragDirection() : false,
|
519
518
|
dragConstraints: getDragDirectionRestriction(dragConstraints),
|
@@ -613,11 +612,12 @@ var getModalContentProps = (animation = "scale", duration) => {
|
|
613
612
|
};
|
614
613
|
var ModalContent = (0, import_motion5.motionForwardRef)(
|
615
614
|
({ className, children, __css, ...rest }, ref) => {
|
615
|
+
var _a, _b;
|
616
616
|
const {
|
617
617
|
animation,
|
618
|
-
|
618
|
+
bodyRef,
|
619
619
|
duration,
|
620
|
-
|
620
|
+
headerRef,
|
621
621
|
scrollBehavior,
|
622
622
|
styles,
|
623
623
|
withCloseButton,
|
@@ -644,8 +644,8 @@ var ModalContent = (0, import_motion5.motionForwardRef)(
|
|
644
644
|
{
|
645
645
|
ref,
|
646
646
|
className: (0, import_utils16.cx)("ui-modal", className),
|
647
|
-
"aria-describedby":
|
648
|
-
"aria-labelledby":
|
647
|
+
"aria-describedby": (_a = bodyRef.current) == null ? void 0 : _a.id,
|
648
|
+
"aria-labelledby": (_b = headerRef.current) == null ? void 0 : _b.id,
|
649
649
|
"aria-modal": "true",
|
650
650
|
role: "dialog",
|
651
651
|
tabIndex: -1,
|
@@ -700,9 +700,9 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
700
700
|
onOverlayClick,
|
701
701
|
...rest
|
702
702
|
} = (0, import_core12.omitThemeProps)(mergedProps);
|
703
|
+
const headerRef = (0, import_react2.useRef)(null);
|
704
|
+
const bodyRef = (0, import_react2.useRef)(null);
|
703
705
|
open != null ? open : open = isOpen;
|
704
|
-
const labelledbyId = (0, import_react2.useId)();
|
705
|
-
const describedbyId = (0, import_react2.useId)();
|
706
706
|
const onKeyDown = (0, import_react2.useCallback)(
|
707
707
|
(ev) => {
|
708
708
|
if (ev.key !== "Escape") return;
|
@@ -740,11 +740,11 @@ var Modal = (0, import_motion6.motionForwardRef)(
|
|
740
740
|
{
|
741
741
|
value: {
|
742
742
|
animation,
|
743
|
+
bodyRef,
|
743
744
|
closeOnOverlay,
|
744
|
-
describedbyId,
|
745
745
|
duration,
|
746
|
+
headerRef,
|
746
747
|
isOpen,
|
747
|
-
labelledbyId,
|
748
748
|
open,
|
749
749
|
scrollBehavior,
|
750
750
|
styles,
|