@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.
Files changed (176) hide show
  1. package/dist/chunk-2EF6C34T.mjs +35 -0
  2. package/dist/chunk-2EF6C34T.mjs.map +1 -0
  3. package/dist/chunk-2GGZOTUT.mjs +32 -0
  4. package/dist/chunk-2GGZOTUT.mjs.map +1 -0
  5. package/dist/chunk-2UHL64SV.mjs +150 -0
  6. package/dist/chunk-2UHL64SV.mjs.map +1 -0
  7. package/dist/chunk-2XQPQIQG.mjs +32 -0
  8. package/dist/chunk-2XQPQIQG.mjs.map +1 -0
  9. package/dist/chunk-3CPIBNSS.mjs +32 -0
  10. package/dist/chunk-3CPIBNSS.mjs.map +1 -0
  11. package/dist/chunk-3S4JQQU3.mjs +32 -0
  12. package/dist/chunk-3S4JQQU3.mjs.map +1 -0
  13. package/dist/chunk-4G6PCQ4G.mjs +51 -0
  14. package/dist/chunk-4G6PCQ4G.mjs.map +1 -0
  15. package/dist/chunk-4J4ISPN7.mjs +26 -0
  16. package/dist/chunk-4J4ISPN7.mjs.map +1 -0
  17. package/dist/chunk-5OKOSAXO.mjs +37 -0
  18. package/dist/chunk-5OKOSAXO.mjs.map +1 -0
  19. package/dist/chunk-B2LUOR6L.mjs +32 -0
  20. package/dist/chunk-B2LUOR6L.mjs.map +1 -0
  21. package/dist/chunk-B436JYPR.mjs +34 -0
  22. package/dist/chunk-B436JYPR.mjs.map +1 -0
  23. package/dist/chunk-CW5ZZAAV.mjs +34 -0
  24. package/dist/chunk-CW5ZZAAV.mjs.map +1 -0
  25. package/dist/chunk-DV6BTDBZ.mjs +32 -0
  26. package/dist/chunk-DV6BTDBZ.mjs.map +1 -0
  27. package/dist/chunk-G646NVHY.mjs +176 -0
  28. package/dist/chunk-G646NVHY.mjs.map +1 -0
  29. package/dist/chunk-HM447TIY.mjs +32 -0
  30. package/dist/chunk-HM447TIY.mjs.map +1 -0
  31. package/dist/chunk-I6LPF3F6.mjs +95 -0
  32. package/dist/chunk-I6LPF3F6.mjs.map +1 -0
  33. package/dist/chunk-OFDDT2JT.mjs +32 -0
  34. package/dist/chunk-OFDDT2JT.mjs.map +1 -0
  35. package/dist/chunk-RSAJUBWR.mjs +32 -0
  36. package/dist/chunk-RSAJUBWR.mjs.map +1 -0
  37. package/dist/chunk-WEDZHILB.mjs +29 -0
  38. package/dist/chunk-WEDZHILB.mjs.map +1 -0
  39. package/dist/chunk-Y2QXIJZA.mjs +138 -0
  40. package/dist/chunk-Y2QXIJZA.mjs.map +1 -0
  41. package/dist/chunk-Y5NCRCDU.mjs +32 -0
  42. package/dist/chunk-Y5NCRCDU.mjs.map +1 -0
  43. package/dist/chunk-ZR2AEIGZ.mjs +116 -0
  44. package/dist/chunk-ZR2AEIGZ.mjs.map +1 -0
  45. package/dist/dialog-body.d.mts +8 -0
  46. package/dist/dialog-body.d.ts +8 -0
  47. package/dist/dialog-body.js +94 -0
  48. package/dist/dialog-body.js.map +1 -0
  49. package/dist/dialog-body.mjs +10 -0
  50. package/dist/dialog-body.mjs.map +1 -0
  51. package/dist/dialog-close-button.d.mts +8 -0
  52. package/dist/dialog-close-button.d.ts +8 -0
  53. package/dist/dialog-close-button.js +96 -0
  54. package/dist/dialog-close-button.js.map +1 -0
  55. package/dist/dialog-close-button.mjs +10 -0
  56. package/dist/dialog-close-button.mjs.map +1 -0
  57. package/dist/dialog-footer.d.mts +8 -0
  58. package/dist/dialog-footer.d.ts +8 -0
  59. package/dist/dialog-footer.js +91 -0
  60. package/dist/dialog-footer.js.map +1 -0
  61. package/dist/dialog-footer.mjs +10 -0
  62. package/dist/dialog-footer.mjs.map +1 -0
  63. package/dist/dialog-header.d.mts +8 -0
  64. package/dist/dialog-header.d.ts +8 -0
  65. package/dist/dialog-header.js +91 -0
  66. package/dist/dialog-header.js.map +1 -0
  67. package/dist/dialog-header.mjs +10 -0
  68. package/dist/dialog-header.mjs.map +1 -0
  69. package/dist/dialog-overlay.d.mts +8 -0
  70. package/dist/dialog-overlay.d.ts +8 -0
  71. package/dist/dialog-overlay.js +108 -0
  72. package/dist/dialog-overlay.js.map +1 -0
  73. package/dist/dialog-overlay.mjs +10 -0
  74. package/dist/dialog-overlay.mjs.map +1 -0
  75. package/dist/dialog.d.mts +7 -21
  76. package/dist/dialog.d.ts +7 -21
  77. package/dist/dialog.js +593 -678
  78. package/dist/dialog.js.map +1 -1
  79. package/dist/dialog.mjs +20 -13
  80. package/dist/drawer-body.d.mts +8 -0
  81. package/dist/drawer-body.d.ts +8 -0
  82. package/dist/drawer-body.js +94 -0
  83. package/dist/drawer-body.js.map +1 -0
  84. package/dist/drawer-body.mjs +10 -0
  85. package/dist/drawer-body.mjs.map +1 -0
  86. package/dist/drawer-close-button.d.mts +9 -0
  87. package/dist/drawer-close-button.d.ts +9 -0
  88. package/dist/drawer-close-button.js +96 -0
  89. package/dist/drawer-close-button.js.map +1 -0
  90. package/dist/drawer-close-button.mjs +10 -0
  91. package/dist/drawer-close-button.mjs.map +1 -0
  92. package/dist/drawer-content.d.mts +16 -0
  93. package/dist/drawer-content.d.ts +16 -0
  94. package/dist/drawer-content.js +278 -0
  95. package/dist/drawer-content.js.map +1 -0
  96. package/dist/drawer-content.mjs +12 -0
  97. package/dist/drawer-content.mjs.map +1 -0
  98. package/dist/drawer-drag-bar.d.mts +8 -0
  99. package/dist/drawer-drag-bar.d.ts +8 -0
  100. package/dist/drawer-drag-bar.js +66 -0
  101. package/dist/drawer-drag-bar.js.map +1 -0
  102. package/dist/drawer-drag-bar.mjs +9 -0
  103. package/dist/drawer-drag-bar.mjs.map +1 -0
  104. package/dist/drawer-footer.d.mts +8 -0
  105. package/dist/drawer-footer.d.ts +8 -0
  106. package/dist/drawer-footer.js +91 -0
  107. package/dist/drawer-footer.js.map +1 -0
  108. package/dist/drawer-footer.mjs +10 -0
  109. package/dist/drawer-footer.mjs.map +1 -0
  110. package/dist/drawer-header.d.mts +8 -0
  111. package/dist/drawer-header.d.ts +8 -0
  112. package/dist/drawer-header.js +91 -0
  113. package/dist/drawer-header.js.map +1 -0
  114. package/dist/drawer-header.mjs +10 -0
  115. package/dist/drawer-header.mjs.map +1 -0
  116. package/dist/drawer-overlay.d.mts +8 -0
  117. package/dist/drawer-overlay.d.ts +8 -0
  118. package/dist/drawer-overlay.js +108 -0
  119. package/dist/drawer-overlay.js.map +1 -0
  120. package/dist/drawer-overlay.mjs +10 -0
  121. package/dist/drawer-overlay.mjs.map +1 -0
  122. package/dist/drawer.d.mts +8 -27
  123. package/dist/drawer.d.ts +8 -27
  124. package/dist/drawer.js +405 -640
  125. package/dist/drawer.js.map +1 -1
  126. package/dist/drawer.mjs +14 -17
  127. package/dist/index.d.mts +13 -2
  128. package/dist/index.d.ts +13 -2
  129. package/dist/index.js +492 -413
  130. package/dist/index.js.map +1 -1
  131. package/dist/index.mjs +56 -18
  132. package/dist/modal-body.d.mts +3 -2
  133. package/dist/modal-body.d.ts +3 -2
  134. package/dist/modal-body.js +13 -856
  135. package/dist/modal-body.js.map +1 -1
  136. package/dist/modal-body.mjs +2 -1
  137. package/dist/modal-close-button.d.mts +3 -2
  138. package/dist/modal-close-button.d.ts +3 -2
  139. package/dist/modal-close-button.js +13 -854
  140. package/dist/modal-close-button.js.map +1 -1
  141. package/dist/modal-close-button.mjs +2 -1
  142. package/dist/modal-content.d.mts +9 -0
  143. package/dist/modal-content.d.ts +9 -0
  144. package/dist/modal-content.js +178 -0
  145. package/dist/modal-content.js.map +1 -0
  146. package/dist/modal-content.mjs +11 -0
  147. package/dist/modal-content.mjs.map +1 -0
  148. package/dist/modal-context.d.mts +27 -0
  149. package/dist/modal-context.d.ts +27 -0
  150. package/dist/modal-context.js +54 -0
  151. package/dist/modal-context.js.map +1 -0
  152. package/dist/modal-context.mjs +18 -0
  153. package/dist/modal-context.mjs.map +1 -0
  154. package/dist/modal-footer.d.mts +2 -1
  155. package/dist/modal-footer.d.ts +2 -1
  156. package/dist/modal-footer.js +13 -857
  157. package/dist/modal-footer.js.map +1 -1
  158. package/dist/modal-footer.mjs +2 -1
  159. package/dist/modal-header.d.mts +2 -1
  160. package/dist/modal-header.d.ts +2 -1
  161. package/dist/modal-header.js +13 -857
  162. package/dist/modal-header.js.map +1 -1
  163. package/dist/modal-header.mjs +2 -1
  164. package/dist/modal-overlay.d.mts +2 -1
  165. package/dist/modal-overlay.d.ts +2 -1
  166. package/dist/modal-overlay.js +16 -843
  167. package/dist/modal-overlay.js.map +1 -1
  168. package/dist/modal-overlay.mjs +2 -1
  169. package/dist/modal.d.mts +10 -14
  170. package/dist/modal.d.ts +10 -14
  171. package/dist/modal.js +183 -508
  172. package/dist/modal.js.map +1 -1
  173. package/dist/modal.mjs +13 -5
  174. package/package.json +10 -10
  175. package/dist/chunk-7PS3HWMF.mjs +0 -938
  176. 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,10 @@
1
+ "use client"
2
+ import {
3
+ DrawerHeader
4
+ } from "./chunk-B2LUOR6L.mjs";
5
+ import "./chunk-B436JYPR.mjs";
6
+ import "./chunk-4J4ISPN7.mjs";
7
+ export {
8
+ DrawerHeader
9
+ };
10
+ //# sourceMappingURL=drawer-header.mjs.map
@@ -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,10 @@
1
+ "use client"
2
+ import {
3
+ DrawerOverlay
4
+ } from "./chunk-Y5NCRCDU.mjs";
5
+ import "./chunk-4G6PCQ4G.mjs";
6
+ import "./chunk-4J4ISPN7.mjs";
7
+ export {
8
+ DrawerOverlay
9
+ };
10
+ //# sourceMappingURL=drawer-overlay.mjs.map
@@ -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
- type DrawerOptions = {
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
- type DrawerProps = Omit<ModalProps, "scrollBehavior" | "animation" | "outside" | "placement" | "dragConstraints" | "dragElastic" | keyof ThemeProps> & ThemeProps<"Drawer"> & DrawerOptions;
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, DrawerBody, type DrawerBodyProps, DrawerCloseButton, type DrawerCloseButtonProps, DrawerContent, DrawerDragBar, type DrawerDragBarProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, type DrawerOverlayProps, type DrawerProps };
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
- type DrawerOptions = {
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
- type DrawerProps = Omit<ModalProps, "scrollBehavior" | "animation" | "outside" | "placement" | "dragConstraints" | "dragElastic" | keyof ThemeProps> & ThemeProps<"Drawer"> & DrawerOptions;
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, DrawerBody, type DrawerBodyProps, DrawerCloseButton, type DrawerCloseButtonProps, DrawerContent, DrawerDragBar, type DrawerDragBarProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, type DrawerOverlayProps, type DrawerProps };
71
+ export { Drawer, type DrawerProps };