@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
package/dist/dialog.js CHANGED
@@ -21,578 +21,233 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/dialog.tsx
22
22
  var dialog_exports = {};
23
23
  __export(dialog_exports, {
24
- Dialog: () => Dialog,
25
- DialogBody: () => DialogBody,
26
- DialogCloseButton: () => DialogCloseButton,
27
- DialogFooter: () => DialogFooter,
28
- DialogHeader: () => DialogHeader,
29
- DialogOverlay: () => DialogOverlay
24
+ Dialog: () => Dialog
30
25
  });
31
26
  module.exports = __toCommonJS(dialog_exports);
32
27
  var import_button = require("@yamada-ui/button");
33
- var import_core7 = require("@yamada-ui/core");
34
- var import_motion4 = require("@yamada-ui/motion");
35
- var import_utils8 = require("@yamada-ui/utils");
28
+ var import_core13 = require("@yamada-ui/core");
29
+ var import_motion7 = require("@yamada-ui/motion");
30
+ var import_utils18 = require("@yamada-ui/utils");
36
31
 
37
- // src/modal.tsx
32
+ // src/dialog-body.tsx
38
33
  var import_core2 = require("@yamada-ui/core");
39
- var import_focus_lock = require("@yamada-ui/focus-lock");
40
- var import_motion2 = require("@yamada-ui/motion");
41
- var import_portal = require("@yamada-ui/portal");
42
- var import_transitions2 = require("@yamada-ui/transitions");
43
- var import_use_value2 = require("@yamada-ui/use-value");
44
- var import_utils2 = require("@yamada-ui/utils");
45
- var import_react2 = require("react");
46
- var import_react_remove_scroll = require("react-remove-scroll");
34
+ var import_utils3 = require("@yamada-ui/utils");
47
35
 
48
- // src/drawer.tsx
36
+ // src/modal-body.tsx
49
37
  var import_core = require("@yamada-ui/core");
50
- var import_motion = require("@yamada-ui/motion");
51
- var import_transitions = require("@yamada-ui/transitions");
52
- var import_use_value = require("@yamada-ui/use-value");
38
+ var import_utils2 = require("@yamada-ui/utils");
39
+
40
+ // src/modal-context.ts
53
41
  var import_utils = require("@yamada-ui/utils");
54
- var import_react = require("react");
55
- var import_jsx_runtime = require("react/jsx-runtime");
42
+ var [ModalProvider, useModal] = (0, import_utils.createContext)({
43
+ name: `ModalContext`,
44
+ errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `
45
+ });
46
+ var [DialogProvider, useDialog] = (0, import_utils.createContext)({
47
+ name: `DialogContext`,
48
+ errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" `
49
+ });
56
50
  var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
57
51
  name: `DrawerContext`,
58
52
  errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in "<Drawer />" `
59
53
  });
60
- var Drawer = (0, import_motion.motionForwardRef)(
61
- ({ size, placement = "right", closeOnDrag = false, ...props }, ref) => {
62
- const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Drawer", {
63
- size,
64
- placement,
65
- closeOnDrag,
66
- ...props
67
- });
68
- const {
69
- children,
70
- isOpen,
71
- onClose,
72
- onOverlayClick,
73
- onEsc,
74
- onCloseComplete,
75
- withCloseButton = !closeOnDrag,
76
- withOverlay = true,
77
- withDragBar = true,
78
- allowPinchZoom,
79
- autoFocus,
80
- restoreFocus,
81
- initialFocusRef,
82
- finalFocusRef,
83
- blockScrollOnMount,
84
- closeOnOverlay,
85
- closeOnEsc,
86
- lockFocusAcrossFrames,
87
- duration = { enter: 0.4, exit: 0.3 },
88
- dragConstraints = 0,
89
- dragElastic = 0.1,
90
- dragOffset = 80,
91
- dragVelocity = 100,
92
- blankForDragProps,
93
- portalProps,
94
- containerProps,
95
- ...rest
96
- } = (0, import_core.omitThemeProps)(mergedProps, ["isFullHeight"]);
97
- const validChildren = (0, import_utils.getValidChildren)(children);
98
- const [customDrawerOverlay, ...cloneChildren] = (0, import_utils.findChildren)(
99
- validChildren,
100
- DrawerOverlay
101
- );
102
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
103
- Modal,
104
- {
105
- ref,
106
- ...{
107
- isOpen,
108
- onClose,
109
- onOverlayClick,
110
- onEsc,
111
- onCloseComplete,
112
- withCloseButton: false,
113
- withOverlay: false,
114
- allowPinchZoom,
115
- autoFocus,
116
- restoreFocus,
117
- initialFocusRef,
118
- finalFocusRef,
119
- blockScrollOnMount,
120
- closeOnOverlay,
121
- closeOnEsc,
122
- lockFocusAcrossFrames,
123
- duration,
124
- portalProps,
125
- containerProps
126
- },
127
- children: [
128
- customDrawerOverlay != null ? customDrawerOverlay : withOverlay ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerOverlay, {}) : null,
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
- DrawerContent,
131
- {
132
- ...{
133
- dragConstraints,
134
- dragElastic,
135
- dragOffset,
136
- dragVelocity,
137
- withCloseButton,
138
- withDragBar,
139
- blankForDragProps,
140
- ...rest,
141
- placement,
142
- closeOnDrag
143
- },
144
- children: cloneChildren
145
- }
146
- )
147
- ]
148
- }
149
- ) });
150
- }
151
- );
152
- var DrawerContent = (0, import_motion.motionForwardRef)(
153
- ({
154
- className,
155
- children,
156
- placement: _placement,
157
- withCloseButton,
158
- withDragBar,
159
- closeOnDrag,
160
- dragConstraints,
161
- dragElastic,
162
- dragOffset,
163
- dragVelocity,
164
- blankForDragProps,
165
- ...rest
166
- }, ref) => {
167
- const { isOpen, onClose, duration } = useModal();
168
- const styles = useDrawer();
169
- const placement = (0, import_use_value.useValue)(_placement);
170
- const validChildren = (0, import_utils.getValidChildren)(children);
171
- const [customDrawerCloseButton, ...cloneChildren] = (0, import_utils.findChildren)(
172
- validChildren,
173
- DrawerCloseButton
174
- );
175
- const blankForDragBg = (0, import_react.useMemo)(() => {
176
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
177
- const propBg = (_c = (_b = (_a = rest.backgroundColor) != null ? _a : rest.bgColor) != null ? _b : rest.background) != null ? _c : rest.bg;
178
- 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;
179
- const computedBg = propBg != null ? propBg : styleBg;
180
- return (0, import_utils.isArray)(computedBg) ? computedBg : [computedBg];
181
- }, [rest, styles]);
182
- const blankForDrag = (0, import_react.useMemo)(() => {
183
- let position = {};
184
- switch (placement) {
185
- case "top":
186
- position = { top: "calc(-100dvh + 1px)", left: 0, right: 0 };
187
- break;
188
- case "bottom":
189
- position = { bottom: "calc(-100dvh + 1px)", left: 0, right: 0 };
190
- break;
191
- case "left":
192
- position = { left: "calc(-100% + 1px)", top: 0, bottom: 0 };
193
- break;
194
- case "right":
195
- position = { right: "calc(-100% + 1px)", top: 0, bottom: 0 };
196
- break;
197
- }
198
- const [lightBg, darkBg] = blankForDragBg;
199
- return {
200
- _after: {
201
- content: '""',
202
- display: "block",
203
- w: "100%",
204
- h: "100dvh",
205
- bg: lightBg,
206
- position: "absolute",
207
- ...position,
208
- ...blankForDragProps
209
- },
210
- _dark: {
211
- _after: {
212
- bg: darkBg
213
- }
214
- }
215
- };
216
- }, [placement, blankForDragBg, blankForDragProps]);
217
- const css = (0, import_react.useMemo)(
218
- () => ({
219
- display: "flex",
220
- flexDirection: placement === "top" || placement === "bottom" ? "column" : "row",
221
- outline: 0,
222
- ...closeOnDrag ? blankForDrag : {},
223
- ...styles.container
224
- }),
225
- [blankForDrag, closeOnDrag, placement, styles]
226
- );
227
- const getDragDirectionRestriction = (0, import_react.useCallback)(
228
- (value) => {
229
- switch (placement) {
230
- case "top":
231
- return { bottom: value };
232
- case "bottom":
233
- return { top: value };
234
- case "left":
235
- return { right: value };
236
- case "right":
237
- return { left: value };
238
- }
239
- },
240
- [placement]
241
- );
242
- const getDragDirection = (0, import_react.useCallback)(() => {
243
- switch (placement) {
244
- case "top":
245
- case "bottom":
246
- return "y";
247
- case "left":
248
- case "right":
249
- return "x";
250
- }
251
- }, [placement]);
252
- const isCloseByDragInfo = (0, import_react.useCallback)(
253
- (info) => {
254
- switch (placement) {
255
- case "top":
256
- return info.velocity.y <= dragVelocity * -1 || info.offset.y <= dragOffset * -1;
257
- case "bottom":
258
- return info.velocity.y >= dragVelocity || info.offset.y >= dragOffset;
259
- case "left":
260
- return info.velocity.x <= dragVelocity * -1 || info.offset.x <= dragOffset * -1;
261
- case "right":
262
- return info.velocity.x >= dragVelocity || info.offset.x >= dragOffset;
263
- }
264
- },
265
- [placement, dragVelocity, dragOffset]
266
- );
267
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
268
- import_transitions.Slide,
54
+
55
+ // src/modal-body.tsx
56
+ var import_jsx_runtime = require("react/jsx-runtime");
57
+ var ModalBody = (0, import_core.forwardRef)(
58
+ ({ className, __css, ...rest }, ref) => {
59
+ const { styles, scrollBehavior } = useModal();
60
+ const css = {
61
+ display: "flex",
62
+ flexDirection: "column",
63
+ alignItems: "flex-start",
64
+ overflow: scrollBehavior === "inside" ? "auto" : void 0,
65
+ ...__css ? __css : styles.body
66
+ };
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
+ import_core.ui.div,
269
69
  {
270
70
  ref,
271
- className: (0, import_utils.cx)("ui-drawer", className),
272
- isOpen,
273
- placement,
274
- duration,
275
- drag: closeOnDrag ? getDragDirection() : false,
276
- dragConstraints: getDragDirectionRestriction(dragConstraints),
277
- dragElastic: getDragDirectionRestriction(dragElastic),
278
- dragSnapToOrigin: true,
279
- dragMomentum: false,
280
- onDragEnd: (_, info) => {
281
- if (isCloseByDragInfo(info)) onClose == null ? void 0 : onClose();
282
- },
283
- tabIndex: -1,
71
+ className: (0, import_utils2.cx)("ui-modal__body", className),
284
72
  __css: css,
285
- ...rest,
286
- children: [
287
- customDrawerCloseButton != null ? customDrawerCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerCloseButton, {}) : null,
288
- withDragBar && closeOnDrag && (placement === "bottom" || placement === "right") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerDragBar, {}) : null,
289
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
290
- import_core.ui.div,
291
- {
292
- className: "ui-drawer__inner",
293
- __css: { display: "flex", flexDirection: "column", ...styles.inner },
294
- children: cloneChildren
295
- }
296
- ),
297
- withDragBar && closeOnDrag && (placement === "top" || placement === "left") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerDragBar, {}) : null
298
- ]
73
+ ...rest
299
74
  }
300
75
  );
301
76
  }
302
77
  );
303
- var DrawerOverlay = (0, import_motion.motionForwardRef)(
78
+
79
+ // src/dialog-body.tsx
80
+ var import_jsx_runtime2 = require("react/jsx-runtime");
81
+ var DialogBody = (0, import_core2.forwardRef)(
304
82
  ({ className, ...rest }, ref) => {
305
- const styles = useDrawer();
306
- const css = { ...styles.overlay };
307
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
308
- ModalOverlay,
83
+ const styles = useDialog();
84
+ const css = { ...styles.body };
85
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
86
+ ModalBody,
309
87
  {
310
88
  ref,
311
- className: (0, import_utils.cx)("ui-drawer__overlay", className),
89
+ className: (0, import_utils3.cx)("ui-dialog__body", className),
312
90
  __css: css,
313
91
  ...rest
314
92
  }
315
93
  );
316
94
  }
317
95
  );
318
- var DrawerDragBar = ({
319
- className,
320
- ...rest
321
- }) => {
322
- const styles = useDrawer();
323
- const css = { ...styles.dragBar };
324
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
325
- import_core.ui.div,
326
- {
327
- className: (0, import_utils.cx)("ui-drawer__drag-bar", className),
328
- __css: css,
329
- ...rest
330
- }
331
- );
332
- };
333
- var DrawerCloseButton = (0, import_core.forwardRef)(
334
- ({ className, ...rest }, ref) => {
335
- const styles = useDrawer();
336
- const css = { ...styles.closeButton };
337
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
338
- ModalCloseButton,
96
+
97
+ // src/dialog-close-button.tsx
98
+ var import_core4 = require("@yamada-ui/core");
99
+ var import_utils5 = require("@yamada-ui/utils");
100
+
101
+ // src/modal-close-button.tsx
102
+ var import_close_button = require("@yamada-ui/close-button");
103
+ var import_core3 = require("@yamada-ui/core");
104
+ var import_utils4 = require("@yamada-ui/utils");
105
+ var import_jsx_runtime3 = require("react/jsx-runtime");
106
+ var ModalCloseButton = (0, import_core3.forwardRef)(
107
+ ({ onClick, __css, ...rest }, ref) => {
108
+ const { styles, onClose } = useModal();
109
+ const css = {
110
+ position: "absolute",
111
+ ...__css ? __css : styles.closeButton
112
+ };
113
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
114
+ import_close_button.CloseButton,
339
115
  {
340
116
  ref,
341
- className: (0, import_utils.cx)("ui-drawer__close-button", className),
117
+ className: (0, import_utils4.cx)("ui-modal__close-button"),
342
118
  __css: css,
119
+ onClick: (0, import_utils4.handlerAll)(onClick, (ev) => {
120
+ ev.stopPropagation();
121
+ onClose == null ? void 0 : onClose();
122
+ }),
343
123
  ...rest
344
124
  }
345
125
  );
346
126
  }
347
127
  );
348
- var DrawerHeader = (0, import_core.forwardRef)(
128
+
129
+ // src/dialog-close-button.tsx
130
+ var import_jsx_runtime4 = require("react/jsx-runtime");
131
+ var DialogCloseButton = (0, import_core4.forwardRef)(
349
132
  ({ className, ...rest }, ref) => {
350
- const styles = useDrawer();
351
- const css = { ...styles.header };
352
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
353
- ModalHeader,
133
+ const styles = useDialog();
134
+ const css = { ...styles.closeButton };
135
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
136
+ ModalCloseButton,
354
137
  {
355
138
  ref,
356
- className: (0, import_utils.cx)("ui-drawer__header", className),
139
+ className: (0, import_utils5.cx)("ui-dialog__close-button", className),
357
140
  __css: css,
358
141
  ...rest
359
142
  }
360
143
  );
361
144
  }
362
145
  );
363
- var DrawerBody = (0, import_core.forwardRef)(
364
- ({ className, ...rest }, ref) => {
365
- const styles = useDrawer();
366
- const css = { ...styles.body };
367
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
368
- ModalBody,
146
+
147
+ // src/dialog-footer.tsx
148
+ var import_core6 = require("@yamada-ui/core");
149
+ var import_utils7 = require("@yamada-ui/utils");
150
+
151
+ // src/modal-footer.tsx
152
+ var import_core5 = require("@yamada-ui/core");
153
+ var import_utils6 = require("@yamada-ui/utils");
154
+ var import_jsx_runtime5 = require("react/jsx-runtime");
155
+ var ModalFooter = (0, import_core5.forwardRef)(
156
+ ({ className, __css, ...rest }, ref) => {
157
+ const { styles } = useModal();
158
+ const css = {
159
+ display: "flex",
160
+ alignItems: "center",
161
+ justifyContent: "flex-end",
162
+ ...__css ? __css : styles.footer
163
+ };
164
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
165
+ import_core5.ui.footer,
369
166
  {
370
167
  ref,
371
- className: (0, import_utils.cx)("ui-drawer__body", className),
168
+ className: (0, import_utils6.cx)("ui-modal__footer", className),
372
169
  __css: css,
373
170
  ...rest
374
171
  }
375
172
  );
376
173
  }
377
174
  );
378
- var DrawerFooter = (0, import_core.forwardRef)(
175
+
176
+ // src/dialog-footer.tsx
177
+ var import_jsx_runtime6 = require("react/jsx-runtime");
178
+ var DialogFooter = (0, import_core6.forwardRef)(
379
179
  ({ className, ...rest }, ref) => {
380
- const styles = useDrawer();
180
+ const styles = useDialog();
381
181
  const css = { ...styles.footer };
382
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
182
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
383
183
  ModalFooter,
384
184
  {
385
185
  ref,
386
- className: (0, import_utils.cx)("ui-drawer__footer", className),
186
+ className: (0, import_utils7.cx)("ui-dialog__footer", className),
387
187
  __css: css,
388
- ...rest
389
- }
390
- );
391
- }
392
- );
393
-
394
- // src/modal.tsx
395
- var import_jsx_runtime2 = require("react/jsx-runtime");
396
- var [ModalProvider, useModal] = (0, import_utils2.createContext)({
397
- name: `ModalContext`,
398
- errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `
399
- });
400
- var Modal = (0, import_motion2.motionForwardRef)(
401
- ({ size, ...props }, ref) => {
402
- const [styles, mergedProps] = (0, import_core2.useMultiComponentStyle)("Modal", {
403
- size,
404
- ...props
405
- });
406
- const {
407
- className,
408
- children,
409
- isOpen,
410
- onClose,
411
- onOverlayClick,
412
- onEsc,
413
- onCloseComplete,
414
- placement: _placement = "center",
415
- outside = "fallback(4, 1rem)",
416
- withCloseButton = true,
417
- withOverlay = true,
418
- allowPinchZoom = false,
419
- scrollBehavior = "inside",
420
- autoFocus,
421
- restoreFocus,
422
- initialFocusRef,
423
- finalFocusRef,
424
- blockScrollOnMount = true,
425
- closeOnOverlay = true,
426
- closeOnEsc = true,
427
- lockFocusAcrossFrames = true,
428
- animation = "scale",
429
- duration,
430
- portalProps,
431
- containerProps,
432
- ...rest
433
- } = (0, import_core2.omitThemeProps)(mergedProps);
434
- const onKeyDown = (0, import_react2.useCallback)(
435
- (ev) => {
436
- if (ev.key !== "Escape") return;
437
- ev.stopPropagation();
438
- if (closeOnEsc) onClose == null ? void 0 : onClose();
439
- onEsc == null ? void 0 : onEsc();
440
- },
441
- [closeOnEsc, onClose, onEsc]
442
- );
443
- const validChildren = (0, import_utils2.getValidChildren)(children);
444
- const [customModalOverlay, ...cloneChildren] = (0, import_utils2.findChildren)(
445
- validChildren,
446
- ModalOverlay,
447
- DialogOverlay,
448
- DrawerOverlay
449
- );
450
- let [drawerContent] = (0, import_utils2.findChildren)(validChildren, DrawerContent);
451
- if (drawerContent)
452
- drawerContent = (0, import_react2.cloneElement)(drawerContent, { onKeyDown });
453
- const placement = (0, import_use_value2.useValue)(_placement);
454
- const css = {
455
- position: "fixed",
456
- top: 0,
457
- left: 0,
458
- zIndex: "fallback(jeice, 110)",
459
- w: "100vw",
460
- h: "100dvh",
461
- p: size !== "full" ? outside : void 0,
462
- display: "flex",
463
- justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
464
- alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center"
465
- };
466
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
467
- ModalProvider,
468
- {
469
- value: {
470
- isOpen,
471
- onClose,
472
- onOverlayClick,
473
- withCloseButton,
474
- scrollBehavior,
475
- closeOnOverlay,
476
- animation,
477
- duration,
478
- styles
479
- },
480
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_motion2.AnimatePresence, { onExitComplete: onCloseComplete, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
481
- import_focus_lock.FocusLock,
482
- {
483
- autoFocus,
484
- initialFocusRef,
485
- finalFocusRef,
486
- restoreFocus,
487
- lockFocusAcrossFrames,
488
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
489
- import_react_remove_scroll.RemoveScroll,
490
- {
491
- allowPinchZoom,
492
- enabled: blockScrollOnMount,
493
- forwardProps: true,
494
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.ui.div, { __css: css, ...containerProps, children: [
495
- customModalOverlay != null ? customModalOverlay : withOverlay && size !== "full" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ModalOverlay, {}) : null,
496
- drawerContent != null ? drawerContent : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
497
- ModalContent,
498
- {
499
- ref,
500
- className,
501
- onKeyDown,
502
- ...rest,
503
- children: cloneChildren
504
- }
505
- )
506
- ] })
507
- }
508
- )
509
- }
510
- ) }) : null })
511
- }
512
- );
513
- }
514
- );
515
- var getModalContentProps = (animation = "scale", duration) => {
516
- switch (animation) {
517
- case "scale":
518
- return {
519
- ...import_transitions2.scaleFadeProps,
520
- custom: { scale: 0.95, reverse: true, duration }
521
- };
522
- case "top":
523
- return {
524
- ...import_transitions2.slideFadeProps,
525
- custom: { offsetY: -16, reverse: true, duration }
526
- };
527
- case "right":
528
- return {
529
- ...import_transitions2.slideFadeProps,
530
- custom: { offsetX: 16, reverse: true, duration }
531
- };
532
- case "left":
533
- return {
534
- ...import_transitions2.slideFadeProps,
535
- custom: { offsetX: -16, reverse: true, duration }
536
- };
537
- case "bottom":
538
- return {
539
- ...import_transitions2.slideFadeProps,
540
- custom: { offsetY: 16, reverse: true, duration }
541
- };
542
- }
543
- };
544
- var ModalContent = (0, import_motion2.motionForwardRef)(
545
- ({ className, children, __css, ...rest }, ref) => {
546
- const {
547
- styles,
548
- scrollBehavior,
549
- withCloseButton,
550
- onClose,
551
- animation,
552
- duration
553
- } = useModal();
554
- const validChildren = (0, import_utils2.getValidChildren)(children);
555
- const [customModalCloseButton, ...cloneChildren] = (0, import_utils2.findChildren)(
556
- validChildren,
557
- ModalCloseButton,
558
- DialogCloseButton
188
+ ...rest
189
+ }
559
190
  );
560
- const props = animation !== "none" ? getModalContentProps(animation, duration) : {};
191
+ }
192
+ );
193
+
194
+ // src/dialog-header.tsx
195
+ var import_core8 = require("@yamada-ui/core");
196
+ var import_utils9 = require("@yamada-ui/utils");
197
+
198
+ // src/modal-header.tsx
199
+ var import_core7 = require("@yamada-ui/core");
200
+ var import_utils8 = require("@yamada-ui/utils");
201
+ var import_jsx_runtime7 = require("react/jsx-runtime");
202
+ var ModalHeader = (0, import_core7.forwardRef)(
203
+ ({ className, __css, ...rest }, ref) => {
204
+ const { styles } = useModal();
561
205
  const css = {
562
- position: "relative",
563
- maxH: "100%",
564
206
  display: "flex",
565
- flexDirection: "column",
566
- overflow: scrollBehavior === "inside" ? "hidden" : "auto",
567
- outline: 0,
568
- ...__css ? __css : styles.container
207
+ alignItems: "center",
208
+ justifyContent: "flex-start",
209
+ ...__css ? __css : styles.header
569
210
  };
570
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
571
- import_motion2.motion.section,
211
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
212
+ import_core7.ui.header,
572
213
  {
573
- role: "dialog",
574
- "aria-modal": "true",
575
214
  ref,
576
- className: (0, import_utils2.cx)("ui-modal", className),
577
- tabIndex: -1,
215
+ className: (0, import_utils8.cx)("ui-modal__header", className),
578
216
  __css: css,
579
- ...props,
580
- ...rest,
581
- children: [
582
- customModalCloseButton != null ? customModalCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ModalCloseButton, {}) : null,
583
- cloneChildren
584
- ]
217
+ ...rest
585
218
  }
586
219
  );
587
220
  }
588
221
  );
589
222
 
223
+ // src/dialog-header.tsx
224
+ var import_jsx_runtime8 = require("react/jsx-runtime");
225
+ var DialogHeader = (0, import_core8.forwardRef)(
226
+ ({ className, ...rest }, ref) => {
227
+ const styles = useDialog();
228
+ const css = { ...styles.header };
229
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
230
+ ModalHeader,
231
+ {
232
+ ref,
233
+ className: (0, import_utils9.cx)("ui-dialog__header", className),
234
+ __css: css,
235
+ ...rest
236
+ }
237
+ );
238
+ }
239
+ );
240
+
241
+ // src/dialog-overlay.tsx
242
+ var import_motion2 = require("@yamada-ui/motion");
243
+ var import_utils11 = require("@yamada-ui/utils");
244
+
590
245
  // src/modal-overlay.tsx
591
- var import_motion3 = require("@yamada-ui/motion");
592
- var import_transitions3 = require("@yamada-ui/transitions");
593
- var import_utils3 = require("@yamada-ui/utils");
594
- var import_jsx_runtime3 = require("react/jsx-runtime");
595
- var ModalOverlay = (0, import_motion3.motionForwardRef)(
246
+ var import_motion = require("@yamada-ui/motion");
247
+ var import_transitions = require("@yamada-ui/transitions");
248
+ var import_utils10 = require("@yamada-ui/utils");
249
+ var import_jsx_runtime9 = require("react/jsx-runtime");
250
+ var ModalOverlay = (0, import_motion.motionForwardRef)(
596
251
  ({ className, __css, onClick, ...rest }, ref) => {
597
252
  const {
598
253
  styles,
@@ -610,15 +265,15 @@ var ModalOverlay = (0, import_motion3.motionForwardRef)(
610
265
  h: "100vh",
611
266
  ...__css ? __css : styles.overlay
612
267
  };
613
- const props = animation !== "none" ? import_transitions3.fadeProps : {};
614
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
615
- import_motion3.motion.div,
268
+ const props = animation !== "none" ? import_transitions.fadeProps : {};
269
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
270
+ import_motion.motion.div,
616
271
  {
617
272
  ref,
618
- className: (0, import_utils3.cx)("ui-modal__overlay", className),
273
+ className: (0, import_utils10.cx)("ui-modal__overlay", className),
619
274
  custom: { duration },
620
275
  __css: css,
621
- onClick: (0, import_utils3.handlerAll)(onClick, onOverlayClick, (ev) => {
276
+ onClick: (0, import_utils10.handlerAll)(onClick, onOverlayClick, (ev) => {
622
277
  ev.stopPropagation();
623
278
  if (closeOnOverlay) onClose == null ? void 0 : onClose();
624
279
  }),
@@ -629,52 +284,249 @@ var ModalOverlay = (0, import_motion3.motionForwardRef)(
629
284
  }
630
285
  );
631
286
 
632
- // src/modal-close-button.tsx
633
- var import_close_button = require("@yamada-ui/close-button");
634
- var import_core3 = require("@yamada-ui/core");
635
- var import_utils4 = require("@yamada-ui/utils");
636
- var import_jsx_runtime4 = require("react/jsx-runtime");
637
- var ModalCloseButton = (0, import_core3.forwardRef)(
638
- ({ onClick, __css, ...rest }, ref) => {
639
- const { styles, onClose } = useModal();
640
- const css = {
641
- position: "absolute",
642
- ...__css ? __css : styles.closeButton
643
- };
644
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
645
- import_close_button.CloseButton,
287
+ // src/dialog-overlay.tsx
288
+ var import_jsx_runtime10 = require("react/jsx-runtime");
289
+ var DialogOverlay = (0, import_motion2.motionForwardRef)(
290
+ ({ className, ...rest }, ref) => {
291
+ const styles = useDialog();
292
+ const css = { ...styles.overlay };
293
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
294
+ ModalOverlay,
646
295
  {
647
296
  ref,
648
- className: (0, import_utils4.cx)("ui-modal__close-button"),
297
+ className: (0, import_utils11.cx)("ui-dialog__overlay", className),
649
298
  __css: css,
650
- onClick: (0, import_utils4.handlerAll)(onClick, (ev) => {
651
- ev.stopPropagation();
652
- onClose == null ? void 0 : onClose();
653
- }),
654
299
  ...rest
655
300
  }
656
301
  );
657
302
  }
658
303
  );
659
304
 
660
- // src/modal-header.tsx
661
- var import_core4 = require("@yamada-ui/core");
662
- var import_utils5 = require("@yamada-ui/utils");
663
- var import_jsx_runtime5 = require("react/jsx-runtime");
664
- var ModalHeader = (0, import_core4.forwardRef)(
305
+ // src/modal.tsx
306
+ var import_core12 = require("@yamada-ui/core");
307
+ var import_focus_lock = require("@yamada-ui/focus-lock");
308
+ var import_motion6 = require("@yamada-ui/motion");
309
+ var import_portal = require("@yamada-ui/portal");
310
+ var import_use_value2 = require("@yamada-ui/use-value");
311
+ var import_utils17 = require("@yamada-ui/utils");
312
+ var import_react2 = require("react");
313
+ var import_react_remove_scroll = require("react-remove-scroll");
314
+
315
+ // src/drawer-content.tsx
316
+ var import_core11 = require("@yamada-ui/core");
317
+ var import_motion3 = require("@yamada-ui/motion");
318
+ var import_transitions2 = require("@yamada-ui/transitions");
319
+ var import_use_value = require("@yamada-ui/use-value");
320
+ var import_utils14 = require("@yamada-ui/utils");
321
+ var import_react = require("react");
322
+
323
+ // src/drawer-close-button.tsx
324
+ var import_core9 = require("@yamada-ui/core");
325
+ var import_utils12 = require("@yamada-ui/utils");
326
+ var import_jsx_runtime11 = require("react/jsx-runtime");
327
+ var DrawerCloseButton = (0, import_core9.forwardRef)(
328
+ ({ className, ...rest }, ref) => {
329
+ const styles = useDrawer();
330
+ const css = { ...styles.closeButton };
331
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
332
+ ModalCloseButton,
333
+ {
334
+ ref,
335
+ className: (0, import_utils12.cx)("ui-drawer__close-button", className),
336
+ __css: css,
337
+ ...rest
338
+ }
339
+ );
340
+ }
341
+ );
342
+
343
+ // src/drawer-drag-bar.tsx
344
+ var import_core10 = require("@yamada-ui/core");
345
+ var import_utils13 = require("@yamada-ui/utils");
346
+ var import_jsx_runtime12 = require("react/jsx-runtime");
347
+ var DrawerDragBar = (0, import_core10.forwardRef)(
665
348
  ({ className, __css, ...rest }, ref) => {
666
- const { styles } = useModal();
667
- const css = {
668
- display: "flex",
669
- alignItems: "center",
670
- justifyContent: "flex-start",
671
- ...__css ? __css : styles.header
672
- };
673
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
674
- import_core4.ui.header,
349
+ const styles = useDrawer();
350
+ const css = { ...styles.dragBar };
351
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
352
+ import_core10.ui.div,
353
+ {
354
+ ref,
355
+ className: (0, import_utils13.cx)("ui-drawer__drag-bar", className),
356
+ __css: css,
357
+ ...rest
358
+ }
359
+ );
360
+ }
361
+ );
362
+
363
+ // src/drawer-content.tsx
364
+ var import_jsx_runtime13 = require("react/jsx-runtime");
365
+ var DrawerContent = (0, import_motion3.motionForwardRef)(
366
+ ({
367
+ className,
368
+ children,
369
+ placement: _placement,
370
+ withCloseButton,
371
+ withDragBar,
372
+ closeOnDrag,
373
+ dragConstraints,
374
+ dragElastic,
375
+ dragOffset,
376
+ dragVelocity,
377
+ blankForDragProps,
378
+ ...rest
379
+ }, ref) => {
380
+ const { isOpen, onClose, duration } = useModal();
381
+ const styles = useDrawer();
382
+ const placement = (0, import_use_value.useValue)(_placement);
383
+ const validChildren = (0, import_utils14.getValidChildren)(children);
384
+ const [customDrawerCloseButton, ...cloneChildren] = (0, import_utils14.findChildren)(
385
+ validChildren,
386
+ DrawerCloseButton
387
+ );
388
+ const blankForDragBg = (0, import_react.useMemo)(() => {
389
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
390
+ const propBg = (_c = (_b = (_a = rest.backgroundColor) != null ? _a : rest.bgColor) != null ? _b : rest.background) != null ? _c : rest.bg;
391
+ 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;
392
+ const computedBg = propBg != null ? propBg : styleBg;
393
+ return (0, import_utils14.isArray)(computedBg) ? computedBg : [computedBg];
394
+ }, [rest, styles]);
395
+ const blankForDrag = (0, import_react.useMemo)(() => {
396
+ let position = {};
397
+ switch (placement) {
398
+ case "top":
399
+ position = { top: "calc(-100dvh + 1px)", left: 0, right: 0 };
400
+ break;
401
+ case "bottom":
402
+ position = { bottom: "calc(-100dvh + 1px)", left: 0, right: 0 };
403
+ break;
404
+ case "left":
405
+ position = { left: "calc(-100% + 1px)", top: 0, bottom: 0 };
406
+ break;
407
+ case "right":
408
+ position = { right: "calc(-100% + 1px)", top: 0, bottom: 0 };
409
+ break;
410
+ }
411
+ const [lightBg, darkBg] = blankForDragBg;
412
+ return {
413
+ _after: {
414
+ content: '""',
415
+ display: "block",
416
+ w: "100%",
417
+ h: "100dvh",
418
+ bg: lightBg,
419
+ position: "absolute",
420
+ ...position,
421
+ ...blankForDragProps
422
+ },
423
+ _dark: {
424
+ _after: {
425
+ bg: darkBg
426
+ }
427
+ }
428
+ };
429
+ }, [placement, blankForDragBg, blankForDragProps]);
430
+ const css = (0, import_react.useMemo)(
431
+ () => ({
432
+ display: "flex",
433
+ flexDirection: placement === "top" || placement === "bottom" ? "column" : "row",
434
+ outline: 0,
435
+ ...closeOnDrag ? blankForDrag : {},
436
+ ...styles.container
437
+ }),
438
+ [blankForDrag, closeOnDrag, placement, styles]
439
+ );
440
+ const getDragDirectionRestriction = (0, import_react.useCallback)(
441
+ (value) => {
442
+ switch (placement) {
443
+ case "top":
444
+ return { bottom: value };
445
+ case "bottom":
446
+ return { top: value };
447
+ case "left":
448
+ return { right: value };
449
+ case "right":
450
+ return { left: value };
451
+ }
452
+ },
453
+ [placement]
454
+ );
455
+ const getDragDirection = (0, import_react.useCallback)(() => {
456
+ switch (placement) {
457
+ case "top":
458
+ case "bottom":
459
+ return "y";
460
+ case "left":
461
+ case "right":
462
+ return "x";
463
+ }
464
+ }, [placement]);
465
+ const isCloseByDragInfo = (0, import_react.useCallback)(
466
+ (info) => {
467
+ switch (placement) {
468
+ case "top":
469
+ return info.velocity.y <= dragVelocity * -1 || info.offset.y <= dragOffset * -1;
470
+ case "bottom":
471
+ return info.velocity.y >= dragVelocity || info.offset.y >= dragOffset;
472
+ case "left":
473
+ return info.velocity.x <= dragVelocity * -1 || info.offset.x <= dragOffset * -1;
474
+ case "right":
475
+ return info.velocity.x >= dragVelocity || info.offset.x >= dragOffset;
476
+ }
477
+ },
478
+ [placement, dragVelocity, dragOffset]
479
+ );
480
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
481
+ import_transitions2.Slide,
482
+ {
483
+ ref,
484
+ className: (0, import_utils14.cx)("ui-drawer", className),
485
+ isOpen,
486
+ placement,
487
+ duration,
488
+ drag: closeOnDrag ? getDragDirection() : false,
489
+ dragConstraints: getDragDirectionRestriction(dragConstraints),
490
+ dragElastic: getDragDirectionRestriction(dragElastic),
491
+ dragSnapToOrigin: true,
492
+ dragMomentum: false,
493
+ onDragEnd: (_, info) => {
494
+ if (isCloseByDragInfo(info)) onClose == null ? void 0 : onClose();
495
+ },
496
+ tabIndex: -1,
497
+ __css: css,
498
+ ...rest,
499
+ children: [
500
+ customDrawerCloseButton != null ? customDrawerCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DrawerCloseButton, {}) : null,
501
+ withDragBar && closeOnDrag && (placement === "bottom" || placement === "right") ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DrawerDragBar, {}) : null,
502
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
503
+ import_core11.ui.div,
504
+ {
505
+ className: "ui-drawer__inner",
506
+ __css: { display: "flex", flexDirection: "column", ...styles.inner },
507
+ children: cloneChildren
508
+ }
509
+ ),
510
+ withDragBar && closeOnDrag && (placement === "top" || placement === "left") ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DrawerDragBar, {}) : null
511
+ ]
512
+ }
513
+ );
514
+ }
515
+ );
516
+
517
+ // src/drawer-overlay.tsx
518
+ var import_motion4 = require("@yamada-ui/motion");
519
+ var import_utils15 = require("@yamada-ui/utils");
520
+ var import_jsx_runtime14 = require("react/jsx-runtime");
521
+ var DrawerOverlay = (0, import_motion4.motionForwardRef)(
522
+ ({ className, ...rest }, ref) => {
523
+ const styles = useDrawer();
524
+ const css = { ...styles.overlay };
525
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
526
+ ModalOverlay,
675
527
  {
676
528
  ref,
677
- className: (0, import_utils5.cx)("ui-modal__header", className),
529
+ className: (0, import_utils15.cx)("ui-drawer__overlay", className),
678
530
  __css: css,
679
531
  ...rest
680
532
  }
@@ -682,66 +534,209 @@ var ModalHeader = (0, import_core4.forwardRef)(
682
534
  }
683
535
  );
684
536
 
685
- // src/modal-body.tsx
686
- var import_core5 = require("@yamada-ui/core");
687
- var import_utils6 = require("@yamada-ui/utils");
688
- var import_jsx_runtime6 = require("react/jsx-runtime");
689
- var ModalBody = (0, import_core5.forwardRef)(
690
- ({ className, __css, ...rest }, ref) => {
691
- const { styles, scrollBehavior } = useModal();
537
+ // src/modal-content.tsx
538
+ var import_motion5 = require("@yamada-ui/motion");
539
+ var import_transitions3 = require("@yamada-ui/transitions");
540
+ var import_utils16 = require("@yamada-ui/utils");
541
+ var import_jsx_runtime15 = require("react/jsx-runtime");
542
+ var getModalContentProps = (animation = "scale", duration) => {
543
+ switch (animation) {
544
+ case "scale":
545
+ return {
546
+ ...import_transitions3.scaleFadeProps,
547
+ custom: { scale: 0.95, reverse: true, duration }
548
+ };
549
+ case "top":
550
+ return {
551
+ ...import_transitions3.slideFadeProps,
552
+ custom: { offsetY: -16, reverse: true, duration }
553
+ };
554
+ case "right":
555
+ return {
556
+ ...import_transitions3.slideFadeProps,
557
+ custom: { offsetX: 16, reverse: true, duration }
558
+ };
559
+ case "left":
560
+ return {
561
+ ...import_transitions3.slideFadeProps,
562
+ custom: { offsetX: -16, reverse: true, duration }
563
+ };
564
+ case "bottom":
565
+ return {
566
+ ...import_transitions3.slideFadeProps,
567
+ custom: { offsetY: 16, reverse: true, duration }
568
+ };
569
+ }
570
+ };
571
+ var ModalContent = (0, import_motion5.motionForwardRef)(
572
+ ({ className, children, __css, ...rest }, ref) => {
573
+ const {
574
+ styles,
575
+ scrollBehavior,
576
+ withCloseButton,
577
+ onClose,
578
+ animation,
579
+ duration
580
+ } = useModal();
581
+ const validChildren = (0, import_utils16.getValidChildren)(children);
582
+ const [customModalCloseButton, ...cloneChildren] = (0, import_utils16.findChildren)(
583
+ validChildren,
584
+ ModalCloseButton,
585
+ DialogCloseButton
586
+ );
587
+ const props = animation !== "none" ? getModalContentProps(animation, duration) : {};
692
588
  const css = {
589
+ position: "relative",
590
+ maxH: "100%",
693
591
  display: "flex",
694
592
  flexDirection: "column",
695
- alignItems: "flex-start",
696
- overflow: scrollBehavior === "inside" ? "auto" : void 0,
697
- ...__css ? __css : styles.body
593
+ overflow: scrollBehavior === "inside" ? "hidden" : "auto",
594
+ outline: 0,
595
+ ...__css ? __css : styles.container
698
596
  };
699
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
700
- import_core5.ui.div,
597
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
598
+ import_motion5.motion.section,
701
599
  {
600
+ role: "dialog",
601
+ "aria-modal": "true",
702
602
  ref,
703
- className: (0, import_utils6.cx)("ui-modal__body", className),
603
+ className: (0, import_utils16.cx)("ui-modal", className),
604
+ tabIndex: -1,
704
605
  __css: css,
705
- ...rest
606
+ ...props,
607
+ ...rest,
608
+ children: [
609
+ customModalCloseButton != null ? customModalCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ModalCloseButton, {}) : null,
610
+ cloneChildren
611
+ ]
706
612
  }
707
613
  );
708
614
  }
709
615
  );
710
616
 
711
- // src/modal-footer.tsx
712
- var import_core6 = require("@yamada-ui/core");
713
- var import_utils7 = require("@yamada-ui/utils");
714
- var import_jsx_runtime7 = require("react/jsx-runtime");
715
- var ModalFooter = (0, import_core6.forwardRef)(
716
- ({ className, __css, ...rest }, ref) => {
717
- const { styles } = useModal();
617
+ // src/modal.tsx
618
+ var import_jsx_runtime16 = require("react/jsx-runtime");
619
+ var Modal = (0, import_motion6.motionForwardRef)(
620
+ ({ size, ...props }, ref) => {
621
+ const [styles, mergedProps] = (0, import_core12.useComponentMultiStyle)("Modal", {
622
+ size,
623
+ ...props
624
+ });
625
+ const {
626
+ className,
627
+ children,
628
+ isOpen,
629
+ onClose,
630
+ onOverlayClick,
631
+ onEsc,
632
+ onCloseComplete,
633
+ placement: _placement = "center",
634
+ outside = "fallback(4, 1rem)",
635
+ withCloseButton = true,
636
+ withOverlay = true,
637
+ allowPinchZoom = false,
638
+ scrollBehavior = "inside",
639
+ autoFocus,
640
+ restoreFocus,
641
+ initialFocusRef,
642
+ finalFocusRef,
643
+ blockScrollOnMount = true,
644
+ closeOnOverlay = true,
645
+ closeOnEsc = true,
646
+ lockFocusAcrossFrames = true,
647
+ animation = "scale",
648
+ duration,
649
+ portalProps,
650
+ containerProps,
651
+ ...rest
652
+ } = (0, import_core12.omitThemeProps)(mergedProps);
653
+ const onKeyDown = (0, import_react2.useCallback)(
654
+ (ev) => {
655
+ if (ev.key !== "Escape") return;
656
+ ev.stopPropagation();
657
+ if (closeOnEsc) onClose == null ? void 0 : onClose();
658
+ onEsc == null ? void 0 : onEsc();
659
+ },
660
+ [closeOnEsc, onClose, onEsc]
661
+ );
662
+ const validChildren = (0, import_utils17.getValidChildren)(children);
663
+ const [customModalOverlay, ...cloneChildren] = (0, import_utils17.findChildren)(
664
+ validChildren,
665
+ ModalOverlay,
666
+ DialogOverlay,
667
+ DrawerOverlay
668
+ );
669
+ let [drawerContent] = (0, import_utils17.findChildren)(validChildren, DrawerContent);
670
+ if (drawerContent)
671
+ drawerContent = (0, import_react2.cloneElement)(drawerContent, { onKeyDown });
672
+ const placement = (0, import_use_value2.useValue)(_placement);
718
673
  const css = {
674
+ position: "fixed",
675
+ top: 0,
676
+ left: 0,
677
+ zIndex: "fallback(jeice, 110)",
678
+ w: "100vw",
679
+ h: "100dvh",
680
+ p: size !== "full" ? outside : void 0,
719
681
  display: "flex",
720
- alignItems: "center",
721
- justifyContent: "flex-end",
722
- ...__css ? __css : styles.footer
682
+ justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
683
+ alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center"
723
684
  };
724
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
725
- import_core6.ui.footer,
685
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
686
+ ModalProvider,
726
687
  {
727
- ref,
728
- className: (0, import_utils7.cx)("ui-modal__footer", className),
729
- __css: css,
730
- ...rest
688
+ value: {
689
+ isOpen,
690
+ onClose,
691
+ onOverlayClick,
692
+ withCloseButton,
693
+ scrollBehavior,
694
+ closeOnOverlay,
695
+ animation,
696
+ duration,
697
+ styles
698
+ },
699
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_motion6.AnimatePresence, { onExitComplete: onCloseComplete, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
700
+ import_focus_lock.FocusLock,
701
+ {
702
+ autoFocus,
703
+ initialFocusRef,
704
+ finalFocusRef,
705
+ restoreFocus,
706
+ lockFocusAcrossFrames,
707
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
708
+ import_react_remove_scroll.RemoveScroll,
709
+ {
710
+ allowPinchZoom,
711
+ enabled: blockScrollOnMount,
712
+ forwardProps: true,
713
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core12.ui.div, { __css: css, ...containerProps, children: [
714
+ customModalOverlay != null ? customModalOverlay : withOverlay && size !== "full" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ModalOverlay, {}) : null,
715
+ drawerContent != null ? drawerContent : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
716
+ ModalContent,
717
+ {
718
+ ref,
719
+ className,
720
+ onKeyDown,
721
+ ...rest,
722
+ children: cloneChildren
723
+ }
724
+ )
725
+ ] })
726
+ }
727
+ )
728
+ }
729
+ ) }) : null })
731
730
  }
732
731
  );
733
732
  }
734
733
  );
735
734
 
736
735
  // src/dialog.tsx
737
- var import_jsx_runtime8 = require("react/jsx-runtime");
738
- var [DialogProvider, useDialog] = (0, import_utils8.createContext)({
739
- name: `DialogContext`,
740
- errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" `
741
- });
742
- var Dialog = (0, import_motion4.motionForwardRef)(
736
+ var import_jsx_runtime17 = require("react/jsx-runtime");
737
+ var Dialog = (0, import_motion7.motionForwardRef)(
743
738
  ({ size, ...props }, ref) => {
744
- const [styles, mergedProps] = (0, import_core7.useMultiComponentStyle)("Dialog", {
739
+ const [styles, mergedProps] = (0, import_core13.useComponentMultiStyle)("Dialog", {
745
740
  size,
746
741
  ...props
747
742
  });
@@ -761,17 +756,17 @@ var Dialog = (0, import_motion4.motionForwardRef)(
761
756
  onSuccess,
762
757
  containerProps,
763
758
  ...rest
764
- } = (0, import_core7.omitThemeProps)(mergedProps);
765
- const validChildren = (0, import_utils8.getValidChildren)(children);
766
- const [customDialogOverlay] = (0, import_utils8.findChildren)(validChildren, DialogOverlay);
767
- const [customDialogCloseButton] = (0, import_utils8.findChildren)(
759
+ } = (0, import_core13.omitThemeProps)(mergedProps);
760
+ const validChildren = (0, import_utils18.getValidChildren)(children);
761
+ const [customDialogOverlay] = (0, import_utils18.findChildren)(validChildren, DialogOverlay);
762
+ const [customDialogCloseButton] = (0, import_utils18.findChildren)(
768
763
  validChildren,
769
764
  DialogCloseButton
770
765
  );
771
- const [customDialogHeader] = (0, import_utils8.findChildren)(validChildren, DialogHeader);
772
- const [customDialogBody] = (0, import_utils8.findChildren)(validChildren, DialogBody);
773
- const [customDialogFooter] = (0, import_utils8.findChildren)(validChildren, DialogFooter);
774
- const cloneChildren = !(0, import_utils8.isEmpty)(validChildren) ? (0, import_utils8.omitChildren)(
766
+ const [customDialogHeader] = (0, import_utils18.findChildren)(validChildren, DialogHeader);
767
+ const [customDialogBody] = (0, import_utils18.findChildren)(validChildren, DialogBody);
768
+ const [customDialogFooter] = (0, import_utils18.findChildren)(validChildren, DialogFooter);
769
+ const cloneChildren = !(0, import_utils18.isEmpty)(validChildren) ? (0, import_utils18.omitChildren)(
775
770
  validChildren,
776
771
  DialogOverlay,
777
772
  DialogCloseButton,
@@ -780,20 +775,20 @@ var Dialog = (0, import_motion4.motionForwardRef)(
780
775
  DialogFooter
781
776
  ) : children;
782
777
  const css = { ...styles.container };
783
- const cancelButtonProps = (0, import_utils8.isValidElement)(cancel) ? { children: cancel } : cancel;
784
- const otherButtonProps = (0, import_utils8.isValidElement)(other) ? { children: other } : other;
785
- const successButtonProps = (0, import_utils8.isValidElement)(success) ? { children: success } : success;
778
+ const cancelButtonProps = (0, import_utils18.isValidElement)(cancel) ? { children: cancel } : cancel;
779
+ const otherButtonProps = (0, import_utils18.isValidElement)(other) ? { children: other } : other;
780
+ const successButtonProps = (0, import_utils18.isValidElement)(success) ? { children: success } : success;
786
781
  if (cancelButtonProps && !cancelButtonProps.variant)
787
782
  cancelButtonProps.variant = "ghost";
788
783
  if (otherButtonProps && !otherButtonProps.colorScheme)
789
784
  otherButtonProps.colorScheme = "secondary";
790
785
  if (successButtonProps && !successButtonProps.colorScheme)
791
786
  successButtonProps.colorScheme = "primary";
792
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
787
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
793
788
  Modal,
794
789
  {
795
790
  ref,
796
- className: (0, import_utils8.cx)("ui-dialog", className),
791
+ className: (0, import_utils18.cx)("ui-dialog", className),
797
792
  __css: css,
798
793
  ...{
799
794
  onClose,
@@ -804,26 +799,26 @@ var Dialog = (0, import_motion4.motionForwardRef)(
804
799
  size
805
800
  },
806
801
  children: [
807
- customDialogOverlay != null ? customDialogOverlay : withOverlay && size !== "full" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogOverlay, {}) : null,
808
- customDialogCloseButton != null ? customDialogCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogCloseButton, {}) : null,
809
- customDialogHeader != null ? customDialogHeader : header ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogHeader, { children: header }) : null,
810
- customDialogBody != null ? customDialogBody : cloneChildren ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogBody, { children: cloneChildren }) : null,
811
- customDialogFooter != null ? customDialogFooter : footer || cancelButtonProps || otherButtonProps || successButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogFooter, { children: footer != null ? footer : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
812
- cancelButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
802
+ customDialogOverlay != null ? customDialogOverlay : withOverlay && size !== "full" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogOverlay, {}) : null,
803
+ customDialogCloseButton != null ? customDialogCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogCloseButton, {}) : null,
804
+ customDialogHeader != null ? customDialogHeader : header ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogHeader, { children: header }) : null,
805
+ customDialogBody != null ? customDialogBody : cloneChildren ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogBody, { children: cloneChildren }) : null,
806
+ customDialogFooter != null ? customDialogFooter : footer || cancelButtonProps || otherButtonProps || successButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogFooter, { children: footer != null ? footer : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
807
+ cancelButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
813
808
  import_button.Button,
814
809
  {
815
810
  onClick: () => onCancel == null ? void 0 : onCancel(onClose),
816
811
  ...cancelButtonProps
817
812
  }
818
813
  ) : null,
819
- otherButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
814
+ otherButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
820
815
  import_button.Button,
821
816
  {
822
817
  onClick: () => onOther == null ? void 0 : onOther(onClose),
823
818
  ...otherButtonProps
824
819
  }
825
820
  ) : null,
826
- successButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
821
+ successButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
827
822
  import_button.Button,
828
823
  {
829
824
  onClick: () => onSuccess == null ? void 0 : onSuccess(onClose),
@@ -836,88 +831,8 @@ var Dialog = (0, import_motion4.motionForwardRef)(
836
831
  ) });
837
832
  }
838
833
  );
839
- var DialogOverlay = (0, import_motion4.motionForwardRef)(
840
- ({ className, ...rest }, ref) => {
841
- const styles = useDialog();
842
- const css = { ...styles.overlay };
843
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
844
- ModalOverlay,
845
- {
846
- ref,
847
- className: (0, import_utils8.cx)("ui-dialog__overlay", className),
848
- __css: css,
849
- ...rest
850
- }
851
- );
852
- }
853
- );
854
- var DialogCloseButton = (0, import_core7.forwardRef)(
855
- ({ className, ...rest }, ref) => {
856
- const styles = useDialog();
857
- const css = { ...styles.closeButton };
858
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
859
- ModalCloseButton,
860
- {
861
- ref,
862
- className: (0, import_utils8.cx)("ui-dialog__close-button", className),
863
- __css: css,
864
- ...rest
865
- }
866
- );
867
- }
868
- );
869
- var DialogHeader = (0, import_core7.forwardRef)(
870
- ({ className, ...rest }, ref) => {
871
- const styles = useDialog();
872
- const css = { ...styles.header };
873
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
874
- ModalHeader,
875
- {
876
- ref,
877
- className: (0, import_utils8.cx)("ui-dialog__header", className),
878
- __css: css,
879
- ...rest
880
- }
881
- );
882
- }
883
- );
884
- var DialogBody = (0, import_core7.forwardRef)(
885
- ({ className, ...rest }, ref) => {
886
- const styles = useDialog();
887
- const css = { ...styles.body };
888
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
889
- ModalBody,
890
- {
891
- ref,
892
- className: (0, import_utils8.cx)("ui-dialog__body", className),
893
- __css: css,
894
- ...rest
895
- }
896
- );
897
- }
898
- );
899
- var DialogFooter = (0, import_core7.forwardRef)(
900
- ({ className, ...rest }, ref) => {
901
- const styles = useDialog();
902
- const css = { ...styles.footer };
903
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
904
- ModalFooter,
905
- {
906
- ref,
907
- className: (0, import_utils8.cx)("ui-dialog__footer", className),
908
- __css: css,
909
- ...rest
910
- }
911
- );
912
- }
913
- );
914
834
  // Annotate the CommonJS export names for ESM import in node:
915
835
  0 && (module.exports = {
916
- Dialog,
917
- DialogBody,
918
- DialogCloseButton,
919
- DialogFooter,
920
- DialogHeader,
921
- DialogOverlay
836
+ Dialog
922
837
  });
923
838
  //# sourceMappingURL=dialog.js.map