@yamada-ui/modal 1.3.9 → 1.3.10-dev-20240917033401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2EF6C34T.mjs +35 -0
- package/dist/chunk-2EF6C34T.mjs.map +1 -0
- package/dist/chunk-2GGZOTUT.mjs +32 -0
- package/dist/chunk-2GGZOTUT.mjs.map +1 -0
- package/dist/chunk-2UHL64SV.mjs +150 -0
- package/dist/chunk-2UHL64SV.mjs.map +1 -0
- package/dist/chunk-2XQPQIQG.mjs +32 -0
- package/dist/chunk-2XQPQIQG.mjs.map +1 -0
- package/dist/chunk-3CPIBNSS.mjs +32 -0
- package/dist/chunk-3CPIBNSS.mjs.map +1 -0
- package/dist/chunk-3S4JQQU3.mjs +32 -0
- package/dist/chunk-3S4JQQU3.mjs.map +1 -0
- package/dist/chunk-4G6PCQ4G.mjs +51 -0
- package/dist/chunk-4G6PCQ4G.mjs.map +1 -0
- package/dist/chunk-4J4ISPN7.mjs +26 -0
- package/dist/chunk-4J4ISPN7.mjs.map +1 -0
- package/dist/chunk-5OKOSAXO.mjs +37 -0
- package/dist/chunk-5OKOSAXO.mjs.map +1 -0
- package/dist/chunk-B2LUOR6L.mjs +32 -0
- package/dist/chunk-B2LUOR6L.mjs.map +1 -0
- package/dist/chunk-B436JYPR.mjs +34 -0
- package/dist/chunk-B436JYPR.mjs.map +1 -0
- package/dist/chunk-CW5ZZAAV.mjs +34 -0
- package/dist/chunk-CW5ZZAAV.mjs.map +1 -0
- package/dist/chunk-DV6BTDBZ.mjs +32 -0
- package/dist/chunk-DV6BTDBZ.mjs.map +1 -0
- package/dist/chunk-G646NVHY.mjs +176 -0
- package/dist/chunk-G646NVHY.mjs.map +1 -0
- package/dist/chunk-HM447TIY.mjs +32 -0
- package/dist/chunk-HM447TIY.mjs.map +1 -0
- package/dist/chunk-I6LPF3F6.mjs +95 -0
- package/dist/chunk-I6LPF3F6.mjs.map +1 -0
- package/dist/chunk-OFDDT2JT.mjs +32 -0
- package/dist/chunk-OFDDT2JT.mjs.map +1 -0
- package/dist/chunk-RSAJUBWR.mjs +32 -0
- package/dist/chunk-RSAJUBWR.mjs.map +1 -0
- package/dist/chunk-WEDZHILB.mjs +29 -0
- package/dist/chunk-WEDZHILB.mjs.map +1 -0
- package/dist/chunk-Y2QXIJZA.mjs +138 -0
- package/dist/chunk-Y2QXIJZA.mjs.map +1 -0
- package/dist/chunk-Y5NCRCDU.mjs +32 -0
- package/dist/chunk-Y5NCRCDU.mjs.map +1 -0
- package/dist/chunk-ZR2AEIGZ.mjs +116 -0
- package/dist/chunk-ZR2AEIGZ.mjs.map +1 -0
- package/dist/dialog-body.d.mts +8 -0
- package/dist/dialog-body.d.ts +8 -0
- package/dist/dialog-body.js +94 -0
- package/dist/dialog-body.js.map +1 -0
- package/dist/dialog-body.mjs +10 -0
- package/dist/dialog-body.mjs.map +1 -0
- package/dist/dialog-close-button.d.mts +8 -0
- package/dist/dialog-close-button.d.ts +8 -0
- package/dist/dialog-close-button.js +96 -0
- package/dist/dialog-close-button.js.map +1 -0
- package/dist/dialog-close-button.mjs +10 -0
- package/dist/dialog-close-button.mjs.map +1 -0
- package/dist/dialog-footer.d.mts +8 -0
- package/dist/dialog-footer.d.ts +8 -0
- package/dist/dialog-footer.js +91 -0
- package/dist/dialog-footer.js.map +1 -0
- package/dist/dialog-footer.mjs +10 -0
- package/dist/dialog-footer.mjs.map +1 -0
- package/dist/dialog-header.d.mts +8 -0
- package/dist/dialog-header.d.ts +8 -0
- package/dist/dialog-header.js +91 -0
- package/dist/dialog-header.js.map +1 -0
- package/dist/dialog-header.mjs +10 -0
- package/dist/dialog-header.mjs.map +1 -0
- package/dist/dialog-overlay.d.mts +8 -0
- package/dist/dialog-overlay.d.ts +8 -0
- package/dist/dialog-overlay.js +108 -0
- package/dist/dialog-overlay.js.map +1 -0
- package/dist/dialog-overlay.mjs +10 -0
- package/dist/dialog-overlay.mjs.map +1 -0
- package/dist/dialog.d.mts +7 -21
- package/dist/dialog.d.ts +7 -21
- package/dist/dialog.js +593 -678
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.mjs +20 -13
- package/dist/drawer-body.d.mts +8 -0
- package/dist/drawer-body.d.ts +8 -0
- package/dist/drawer-body.js +94 -0
- package/dist/drawer-body.js.map +1 -0
- package/dist/drawer-body.mjs +10 -0
- package/dist/drawer-body.mjs.map +1 -0
- package/dist/drawer-close-button.d.mts +9 -0
- package/dist/drawer-close-button.d.ts +9 -0
- package/dist/drawer-close-button.js +96 -0
- package/dist/drawer-close-button.js.map +1 -0
- package/dist/drawer-close-button.mjs +10 -0
- package/dist/drawer-close-button.mjs.map +1 -0
- package/dist/drawer-content.d.mts +16 -0
- package/dist/drawer-content.d.ts +16 -0
- package/dist/drawer-content.js +278 -0
- package/dist/drawer-content.js.map +1 -0
- package/dist/drawer-content.mjs +12 -0
- package/dist/drawer-content.mjs.map +1 -0
- package/dist/drawer-drag-bar.d.mts +8 -0
- package/dist/drawer-drag-bar.d.ts +8 -0
- package/dist/drawer-drag-bar.js +66 -0
- package/dist/drawer-drag-bar.js.map +1 -0
- package/dist/drawer-drag-bar.mjs +9 -0
- package/dist/drawer-drag-bar.mjs.map +1 -0
- package/dist/drawer-footer.d.mts +8 -0
- package/dist/drawer-footer.d.ts +8 -0
- package/dist/drawer-footer.js +91 -0
- package/dist/drawer-footer.js.map +1 -0
- package/dist/drawer-footer.mjs +10 -0
- package/dist/drawer-footer.mjs.map +1 -0
- package/dist/drawer-header.d.mts +8 -0
- package/dist/drawer-header.d.ts +8 -0
- package/dist/drawer-header.js +91 -0
- package/dist/drawer-header.js.map +1 -0
- package/dist/drawer-header.mjs +10 -0
- package/dist/drawer-header.mjs.map +1 -0
- package/dist/drawer-overlay.d.mts +8 -0
- package/dist/drawer-overlay.d.ts +8 -0
- package/dist/drawer-overlay.js +108 -0
- package/dist/drawer-overlay.js.map +1 -0
- package/dist/drawer-overlay.mjs +10 -0
- package/dist/drawer-overlay.mjs.map +1 -0
- package/dist/drawer.d.mts +8 -27
- package/dist/drawer.d.ts +8 -27
- package/dist/drawer.js +405 -640
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +14 -17
- package/dist/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +492 -413
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -18
- package/dist/modal-body.d.mts +3 -2
- package/dist/modal-body.d.ts +3 -2
- package/dist/modal-body.js +13 -856
- package/dist/modal-body.js.map +1 -1
- package/dist/modal-body.mjs +2 -1
- package/dist/modal-close-button.d.mts +3 -2
- package/dist/modal-close-button.d.ts +3 -2
- package/dist/modal-close-button.js +13 -854
- package/dist/modal-close-button.js.map +1 -1
- package/dist/modal-close-button.mjs +2 -1
- package/dist/modal-content.d.mts +9 -0
- package/dist/modal-content.d.ts +9 -0
- package/dist/modal-content.js +178 -0
- package/dist/modal-content.js.map +1 -0
- package/dist/modal-content.mjs +11 -0
- package/dist/modal-content.mjs.map +1 -0
- package/dist/modal-context.d.mts +27 -0
- package/dist/modal-context.d.ts +27 -0
- package/dist/modal-context.js +54 -0
- package/dist/modal-context.js.map +1 -0
- package/dist/modal-context.mjs +18 -0
- package/dist/modal-context.mjs.map +1 -0
- package/dist/modal-footer.d.mts +2 -1
- package/dist/modal-footer.d.ts +2 -1
- package/dist/modal-footer.js +13 -857
- package/dist/modal-footer.js.map +1 -1
- package/dist/modal-footer.mjs +2 -1
- package/dist/modal-header.d.mts +2 -1
- package/dist/modal-header.d.ts +2 -1
- package/dist/modal-header.js +13 -857
- package/dist/modal-header.js.map +1 -1
- package/dist/modal-header.mjs +2 -1
- package/dist/modal-overlay.d.mts +2 -1
- package/dist/modal-overlay.d.ts +2 -1
- package/dist/modal-overlay.js +16 -843
- package/dist/modal-overlay.js.map +1 -1
- package/dist/modal-overlay.mjs +2 -1
- package/dist/modal.d.mts +10 -14
- package/dist/modal.d.ts +10 -14
- package/dist/modal.js +183 -508
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +13 -5
- package/package.json +10 -10
- package/dist/chunk-7PS3HWMF.mjs +0 -938
- package/dist/chunk-7PS3HWMF.mjs.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/drawer-header.tsx
|
|
22
|
+
var drawer_header_exports = {};
|
|
23
|
+
__export(drawer_header_exports, {
|
|
24
|
+
DrawerHeader: () => DrawerHeader
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(drawer_header_exports);
|
|
27
|
+
var import_core2 = require("@yamada-ui/core");
|
|
28
|
+
var import_utils3 = require("@yamada-ui/utils");
|
|
29
|
+
|
|
30
|
+
// src/modal-context.ts
|
|
31
|
+
var import_utils = require("@yamada-ui/utils");
|
|
32
|
+
var [ModalProvider, useModal] = (0, import_utils.createContext)({
|
|
33
|
+
name: `ModalContext`,
|
|
34
|
+
errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `
|
|
35
|
+
});
|
|
36
|
+
var [DialogProvider, useDialog] = (0, import_utils.createContext)({
|
|
37
|
+
name: `DialogContext`,
|
|
38
|
+
errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" `
|
|
39
|
+
});
|
|
40
|
+
var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
41
|
+
name: `DrawerContext`,
|
|
42
|
+
errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in "<Drawer />" `
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// src/modal-header.tsx
|
|
46
|
+
var import_core = require("@yamada-ui/core");
|
|
47
|
+
var import_utils2 = require("@yamada-ui/utils");
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
var ModalHeader = (0, import_core.forwardRef)(
|
|
50
|
+
({ className, __css, ...rest }, ref) => {
|
|
51
|
+
const { styles } = useModal();
|
|
52
|
+
const css = {
|
|
53
|
+
display: "flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "flex-start",
|
|
56
|
+
...__css ? __css : styles.header
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_core.ui.header,
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
className: (0, import_utils2.cx)("ui-modal__header", className),
|
|
63
|
+
__css: css,
|
|
64
|
+
...rest
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// src/drawer-header.tsx
|
|
71
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
72
|
+
var DrawerHeader = (0, import_core2.forwardRef)(
|
|
73
|
+
({ className, ...rest }, ref) => {
|
|
74
|
+
const styles = useDrawer();
|
|
75
|
+
const css = { ...styles.header };
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
77
|
+
ModalHeader,
|
|
78
|
+
{
|
|
79
|
+
ref,
|
|
80
|
+
className: (0, import_utils3.cx)("ui-drawer__header", className),
|
|
81
|
+
__css: css,
|
|
82
|
+
...rest
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
DrawerHeader
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=drawer-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/drawer-header.tsx","../src/modal-context.ts","../src/modal-header.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport type { ModalHeaderProps } from \"./modal-header\"\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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { ModalOptions } from \"./modal\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { HTMLUIProps, CSSUIObject } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalHeaderProps extends HTMLUIProps<\"header\"> {}\n\nexport const ModalHeader = forwardRef<ModalHeaderProps, \"header\">(\n ({ className, __css, ...rest }, ref) => {\n const { styles } = useModal()\n\n const css: CSSUIObject = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n ...(__css ? __css : styles.header),\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-modal__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,eAA2B;AAC3B,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAOvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AC5BD,kBAA+B;AAC/B,IAAAC,gBAAmB;AAiBb;AAZC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,OAAO,GAAG,KAAK,GAAG,QAAQ;AACtC,UAAM,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,MAAmB;AAAA,MACvB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;;;AFXM,IAAAC,sBAAA;AAPC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,OAAO;AAE5C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["import_core","import_utils","import_utils","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
3
|
+
|
|
4
|
+
interface DrawerOverlayProps extends ModalOverlayProps {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerOverlay: _yamada_ui_motion.MotionComponent<"div", DrawerOverlayProps>;
|
|
7
|
+
|
|
8
|
+
export { DrawerOverlay, type DrawerOverlayProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ModalOverlayProps } from './modal-overlay.js';
|
|
3
|
+
|
|
4
|
+
interface DrawerOverlayProps extends ModalOverlayProps {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerOverlay: _yamada_ui_motion.MotionComponent<"div", DrawerOverlayProps>;
|
|
7
|
+
|
|
8
|
+
export { DrawerOverlay, type DrawerOverlayProps };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/drawer-overlay.tsx
|
|
22
|
+
var drawer_overlay_exports = {};
|
|
23
|
+
__export(drawer_overlay_exports, {
|
|
24
|
+
DrawerOverlay: () => DrawerOverlay
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(drawer_overlay_exports);
|
|
27
|
+
var import_motion2 = require("@yamada-ui/motion");
|
|
28
|
+
var import_utils3 = require("@yamada-ui/utils");
|
|
29
|
+
|
|
30
|
+
// src/modal-context.ts
|
|
31
|
+
var import_utils = require("@yamada-ui/utils");
|
|
32
|
+
var [ModalProvider, useModal] = (0, import_utils.createContext)({
|
|
33
|
+
name: `ModalContext`,
|
|
34
|
+
errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `
|
|
35
|
+
});
|
|
36
|
+
var [DialogProvider, useDialog] = (0, import_utils.createContext)({
|
|
37
|
+
name: `DialogContext`,
|
|
38
|
+
errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" `
|
|
39
|
+
});
|
|
40
|
+
var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
41
|
+
name: `DrawerContext`,
|
|
42
|
+
errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in "<Drawer />" `
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// src/modal-overlay.tsx
|
|
46
|
+
var import_motion = require("@yamada-ui/motion");
|
|
47
|
+
var import_transitions = require("@yamada-ui/transitions");
|
|
48
|
+
var import_utils2 = require("@yamada-ui/utils");
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var ModalOverlay = (0, import_motion.motionForwardRef)(
|
|
51
|
+
({ className, __css, onClick, ...rest }, ref) => {
|
|
52
|
+
const {
|
|
53
|
+
styles,
|
|
54
|
+
closeOnOverlay,
|
|
55
|
+
onOverlayClick,
|
|
56
|
+
onClose,
|
|
57
|
+
animation,
|
|
58
|
+
duration
|
|
59
|
+
} = useModal();
|
|
60
|
+
const css = {
|
|
61
|
+
position: "fixed",
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
w: "100vw",
|
|
65
|
+
h: "100vh",
|
|
66
|
+
...__css ? __css : styles.overlay
|
|
67
|
+
};
|
|
68
|
+
const props = animation !== "none" ? import_transitions.fadeProps : {};
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
import_motion.motion.div,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: (0, import_utils2.cx)("ui-modal__overlay", className),
|
|
74
|
+
custom: { duration },
|
|
75
|
+
__css: css,
|
|
76
|
+
onClick: (0, import_utils2.handlerAll)(onClick, onOverlayClick, (ev) => {
|
|
77
|
+
ev.stopPropagation();
|
|
78
|
+
if (closeOnOverlay) onClose == null ? void 0 : onClose();
|
|
79
|
+
}),
|
|
80
|
+
...props,
|
|
81
|
+
...rest
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// src/drawer-overlay.tsx
|
|
88
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
89
|
+
var DrawerOverlay = (0, import_motion2.motionForwardRef)(
|
|
90
|
+
({ className, ...rest }, ref) => {
|
|
91
|
+
const styles = useDrawer();
|
|
92
|
+
const css = { ...styles.overlay };
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
94
|
+
ModalOverlay,
|
|
95
|
+
{
|
|
96
|
+
ref,
|
|
97
|
+
className: (0, import_utils3.cx)("ui-drawer__overlay", className),
|
|
98
|
+
__css: css,
|
|
99
|
+
...rest
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
+
0 && (module.exports = {
|
|
106
|
+
DrawerOverlay
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=drawer-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/drawer-overlay.tsx","../src/modal-context.ts","../src/modal-overlay.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { motionForwardRef } from \"@yamada-ui/motion\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useDrawer } from \"./modal-context\"\nimport type { ModalOverlayProps } from \"./modal-overlay\"\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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { ModalOptions } from \"./modal\"\n\ninterface ModalContext extends ModalOptions {\n styles: { [key: string]: CSSUIObject }\n}\n\nexport const [ModalProvider, useModal] = createContext<ModalContext>({\n name: `ModalContext`,\n errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" `,\n})\n\ninterface DialogContext {\n [key: string]: CSSUIObject\n}\n\nexport const [DialogProvider, useDialog] = createContext<DialogContext>({\n name: `DialogContext`,\n errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in \"<Dialog />\" `,\n})\n\ninterface DrawerContext {\n [key: string]: CSSUIObject\n}\n\nexport const [DrawerProvider, useDrawer] = createContext<DrawerContext>({\n name: `DrawerContext`,\n errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in \"<Drawer />\" `,\n})\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { motion, motionForwardRef } from \"@yamada-ui/motion\"\nimport { fadeProps } from \"@yamada-ui/transitions\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport { useModal } from \"./modal-context\"\n\nexport interface ModalOverlayProps extends MotionProps {}\n\nexport const ModalOverlay = motionForwardRef<ModalOverlayProps, \"div\">(\n ({ className, __css, onClick, ...rest }, ref) => {\n const {\n styles,\n closeOnOverlay,\n onOverlayClick,\n onClose,\n animation,\n duration,\n } = useModal()\n\n const css: CSSUIObject = {\n position: \"fixed\",\n top: 0,\n left: 0,\n w: \"100vw\",\n h: \"100vh\",\n ...(__css ? __css : styles.overlay),\n }\n\n const props = animation !== \"none\" ? fadeProps : {}\n\n return (\n <motion.div\n ref={ref}\n className={cx(\"ui-modal__overlay\", className)}\n custom={{ duration }}\n __css={css}\n onClick={handlerAll(onClick, onOverlayClick, (ev) => {\n ev.stopPropagation()\n if (closeOnOverlay) onClose?.()\n })}\n {...props}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,iBAAiC;AACjC,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAOvB,IAAM,CAAC,eAAe,QAAQ,QAAI,4BAA4B;AAAA,EACnE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,gBAAgB,SAAS,QAAI,4BAA6B;AAAA,EACtE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AC3BD,oBAAyC;AACzC,yBAA0B;AAC1B,IAAAC,gBAA+B;AA4BzB;AAvBC,IAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,OAAO,SAAS,GAAG,KAAK,GAAG,QAAQ;AAC/C,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,SAAS;AAEb,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,QAAQ,QAAQ,OAAO;AAAA,IAC7B;AAEA,UAAM,QAAQ,cAAc,SAAS,+BAAY,CAAC;AAElD,WACE;AAAA,MAAC,qBAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,QAAQ,EAAE,SAAS;AAAA,QACnB,OAAO;AAAA,QACP,aAAS,0BAAW,SAAS,gBAAgB,CAAC,OAAO;AACnD,aAAG,gBAAgB;AACnB,cAAI,eAAgB;AAAA,QACtB,CAAC;AAAA,QACA,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;;;AF9BM,IAAAC,sBAAA;AAPC,IAAM,oBAAgB;AAAA,EAC3B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,UAAU;AAEzB,UAAM,MAAmB,EAAE,GAAG,OAAO,QAAQ;AAE7C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,sBAAsB,SAAS;AAAA,QAC7C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["import_motion","import_utils","import_utils","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/drawer.d.mts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
-
import { ThemeProps, HTMLUIProps, CSSUIObject } from '@yamada-ui/core';
|
|
3
|
-
import * as _yamada_ui_close_button from '@yamada-ui/close-button';
|
|
4
1
|
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
5
3
|
import { SlideProps } from '@yamada-ui/transitions';
|
|
6
|
-
import { FC } from 'react';
|
|
7
4
|
import { ModalProps } from './modal.mjs';
|
|
8
|
-
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
9
|
-
import { ModalCloseButtonProps } from './modal-close-button.mjs';
|
|
10
|
-
import { ModalHeaderProps } from './modal-header.mjs';
|
|
11
|
-
import { ModalBodyProps } from './modal-body.mjs';
|
|
12
|
-
import { ModalFooterProps } from './modal-footer.mjs';
|
|
13
5
|
import '@yamada-ui/focus-lock';
|
|
14
6
|
import '@yamada-ui/portal';
|
|
7
|
+
import './modal-content.mjs';
|
|
8
|
+
import 'react';
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
interface DrawerOptions {
|
|
17
11
|
/**
|
|
18
12
|
* The placement of the drawer.
|
|
19
13
|
*
|
|
@@ -64,27 +58,14 @@ type DrawerOptions = {
|
|
|
64
58
|
* Props for the blank area when `closeOnDrag` is `true`.
|
|
65
59
|
*/
|
|
66
60
|
blankForDragProps?: CSSUIObject;
|
|
67
|
-
}
|
|
68
|
-
|
|
61
|
+
}
|
|
62
|
+
interface DrawerProps extends Omit<ModalProps, "scrollBehavior" | "animation" | "outside" | "placement" | "dragConstraints" | "dragElastic" | keyof ThemeProps>, ThemeProps<"Drawer">, DrawerOptions {
|
|
63
|
+
}
|
|
69
64
|
/**
|
|
70
65
|
* `Drawer` is a component for a panel that appears from the edge of the screen.
|
|
71
66
|
*
|
|
72
67
|
* @see Docs https://yamada-ui.com/components/overlay/drawer
|
|
73
68
|
*/
|
|
74
69
|
declare const Drawer: _yamada_ui_motion.MotionComponent<"div", DrawerProps>;
|
|
75
|
-
type DrawerContentProps = Omit<DrawerProps, "isOpen" | "placement" | keyof ThemeProps> & Required<Pick<DrawerProps, "placement" | "dragConstraints" | "dragElastic" | "dragOffset" | "dragVelocity" | "placement">>;
|
|
76
|
-
declare const DrawerContent: _yamada_ui_motion.MotionComponent<"div", DrawerContentProps>;
|
|
77
|
-
type DrawerOverlayProps = ModalOverlayProps;
|
|
78
|
-
declare const DrawerOverlay: _yamada_ui_motion.MotionComponent<"div", ModalOverlayProps>;
|
|
79
|
-
type DrawerDragBarProps = HTMLUIProps<"div">;
|
|
80
|
-
declare const DrawerDragBar: FC<DrawerDragBarProps>;
|
|
81
|
-
type DrawerCloseButtonProps = ModalCloseButtonProps;
|
|
82
|
-
declare const DrawerCloseButton: _yamada_ui_core.Component<"button", _yamada_ui_close_button.CloseButtonProps>;
|
|
83
|
-
type DrawerHeaderProps = ModalHeaderProps;
|
|
84
|
-
declare const DrawerHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
85
|
-
type DrawerBodyProps = ModalBodyProps;
|
|
86
|
-
declare const DrawerBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
87
|
-
type DrawerFooterProps = ModalFooterProps;
|
|
88
|
-
declare const DrawerFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
89
70
|
|
|
90
|
-
export { Drawer,
|
|
71
|
+
export { Drawer, type DrawerProps };
|
package/dist/drawer.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
-
import { ThemeProps, HTMLUIProps, CSSUIObject } from '@yamada-ui/core';
|
|
3
|
-
import * as _yamada_ui_close_button from '@yamada-ui/close-button';
|
|
4
1
|
import * as _yamada_ui_motion from '@yamada-ui/motion';
|
|
2
|
+
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
5
3
|
import { SlideProps } from '@yamada-ui/transitions';
|
|
6
|
-
import { FC } from 'react';
|
|
7
4
|
import { ModalProps } from './modal.js';
|
|
8
|
-
import { ModalOverlayProps } from './modal-overlay.js';
|
|
9
|
-
import { ModalCloseButtonProps } from './modal-close-button.js';
|
|
10
|
-
import { ModalHeaderProps } from './modal-header.js';
|
|
11
|
-
import { ModalBodyProps } from './modal-body.js';
|
|
12
|
-
import { ModalFooterProps } from './modal-footer.js';
|
|
13
5
|
import '@yamada-ui/focus-lock';
|
|
14
6
|
import '@yamada-ui/portal';
|
|
7
|
+
import './modal-content.js';
|
|
8
|
+
import 'react';
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
interface DrawerOptions {
|
|
17
11
|
/**
|
|
18
12
|
* The placement of the drawer.
|
|
19
13
|
*
|
|
@@ -64,27 +58,14 @@ type DrawerOptions = {
|
|
|
64
58
|
* Props for the blank area when `closeOnDrag` is `true`.
|
|
65
59
|
*/
|
|
66
60
|
blankForDragProps?: CSSUIObject;
|
|
67
|
-
}
|
|
68
|
-
|
|
61
|
+
}
|
|
62
|
+
interface DrawerProps extends Omit<ModalProps, "scrollBehavior" | "animation" | "outside" | "placement" | "dragConstraints" | "dragElastic" | keyof ThemeProps>, ThemeProps<"Drawer">, DrawerOptions {
|
|
63
|
+
}
|
|
69
64
|
/**
|
|
70
65
|
* `Drawer` is a component for a panel that appears from the edge of the screen.
|
|
71
66
|
*
|
|
72
67
|
* @see Docs https://yamada-ui.com/components/overlay/drawer
|
|
73
68
|
*/
|
|
74
69
|
declare const Drawer: _yamada_ui_motion.MotionComponent<"div", DrawerProps>;
|
|
75
|
-
type DrawerContentProps = Omit<DrawerProps, "isOpen" | "placement" | keyof ThemeProps> & Required<Pick<DrawerProps, "placement" | "dragConstraints" | "dragElastic" | "dragOffset" | "dragVelocity" | "placement">>;
|
|
76
|
-
declare const DrawerContent: _yamada_ui_motion.MotionComponent<"div", DrawerContentProps>;
|
|
77
|
-
type DrawerOverlayProps = ModalOverlayProps;
|
|
78
|
-
declare const DrawerOverlay: _yamada_ui_motion.MotionComponent<"div", ModalOverlayProps>;
|
|
79
|
-
type DrawerDragBarProps = HTMLUIProps<"div">;
|
|
80
|
-
declare const DrawerDragBar: FC<DrawerDragBarProps>;
|
|
81
|
-
type DrawerCloseButtonProps = ModalCloseButtonProps;
|
|
82
|
-
declare const DrawerCloseButton: _yamada_ui_core.Component<"button", _yamada_ui_close_button.CloseButtonProps>;
|
|
83
|
-
type DrawerHeaderProps = ModalHeaderProps;
|
|
84
|
-
declare const DrawerHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
85
|
-
type DrawerBodyProps = ModalBodyProps;
|
|
86
|
-
declare const DrawerBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
87
|
-
type DrawerFooterProps = ModalFooterProps;
|
|
88
|
-
declare const DrawerFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
89
70
|
|
|
90
|
-
export { Drawer,
|
|
71
|
+
export { Drawer, type DrawerProps };
|