@yamada-ui/modal 1.3.12-next-20241005220055 → 1.3.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/dist/{chunk-KNCDANWW.mjs → chunk-37MTMX5B.mjs} +3 -3
  2. package/dist/{chunk-KNCDANWW.mjs.map → chunk-37MTMX5B.mjs.map} +1 -1
  3. package/dist/{chunk-SHVXETTC.mjs → chunk-6XAWCUQQ.mjs} +3 -3
  4. package/dist/{chunk-SHVXETTC.mjs.map → chunk-6XAWCUQQ.mjs.map} +1 -1
  5. package/dist/{chunk-3K5JY6KM.mjs → chunk-7EVREJIH.mjs} +19 -19
  6. package/dist/chunk-7EVREJIH.mjs.map +1 -0
  7. package/dist/{chunk-IIKFZB3M.mjs → chunk-7I5LX3VI.mjs} +43 -43
  8. package/dist/chunk-7I5LX3VI.mjs.map +1 -0
  9. package/dist/{chunk-3BTHYYAS.mjs → chunk-7THNENCM.mjs} +36 -32
  10. package/dist/chunk-7THNENCM.mjs.map +1 -0
  11. package/dist/{chunk-4J4ISPN7.mjs → chunk-A7WOQJCA.mjs} +1 -1
  12. package/dist/chunk-A7WOQJCA.mjs.map +1 -0
  13. package/dist/{chunk-2LLDUYTG.mjs → chunk-BNRFPNWF.mjs} +3 -3
  14. package/dist/{chunk-2LLDUYTG.mjs.map → chunk-BNRFPNWF.mjs.map} +1 -1
  15. package/dist/{chunk-HUI5FLPV.mjs → chunk-EDCPPJBS.mjs} +3 -3
  16. package/dist/{chunk-HUI5FLPV.mjs.map → chunk-EDCPPJBS.mjs.map} +1 -1
  17. package/dist/{chunk-XKKFTAXR.mjs → chunk-G7R3GU24.mjs} +3 -3
  18. package/dist/{chunk-XKKFTAXR.mjs.map → chunk-G7R3GU24.mjs.map} +1 -1
  19. package/dist/{chunk-LG73B7RP.mjs → chunk-L353QQ6S.mjs} +4 -4
  20. package/dist/{chunk-LG73B7RP.mjs.map → chunk-L353QQ6S.mjs.map} +1 -1
  21. package/dist/{chunk-BQAR3Q4F.mjs → chunk-LUSTM3GA.mjs} +3 -3
  22. package/dist/{chunk-SIKHBBVB.mjs → chunk-LYMMHCHF.mjs} +4 -4
  23. package/dist/{chunk-SIKHBBVB.mjs.map → chunk-LYMMHCHF.mjs.map} +1 -1
  24. package/dist/{chunk-K4MJNSAV.mjs → chunk-OAECULYV.mjs} +2 -2
  25. package/dist/{chunk-LK36SQZ5.mjs → chunk-P5SCGBP7.mjs} +19 -19
  26. package/dist/{chunk-LK36SQZ5.mjs.map → chunk-P5SCGBP7.mjs.map} +1 -1
  27. package/dist/{chunk-VSX32COP.mjs → chunk-PDW7A62B.mjs} +3 -3
  28. package/dist/{chunk-VSX32COP.mjs.map → chunk-PDW7A62B.mjs.map} +1 -1
  29. package/dist/{chunk-LD26U4D3.mjs → chunk-TXXRGDQR.mjs} +3 -3
  30. package/dist/{chunk-LD26U4D3.mjs.map → chunk-TXXRGDQR.mjs.map} +1 -1
  31. package/dist/{chunk-LTFXOP3I.mjs → chunk-VB44U6WY.mjs} +10 -10
  32. package/dist/{chunk-LTFXOP3I.mjs.map → chunk-VB44U6WY.mjs.map} +1 -1
  33. package/dist/{chunk-XFLVRTWU.mjs → chunk-VMTMWWII.mjs} +3 -3
  34. package/dist/{chunk-XFLVRTWU.mjs.map → chunk-VMTMWWII.mjs.map} +1 -1
  35. package/dist/{chunk-6NMJJILM.mjs → chunk-VNQHFTL2.mjs} +3 -3
  36. package/dist/{chunk-6NMJJILM.mjs.map → chunk-VNQHFTL2.mjs.map} +1 -1
  37. package/dist/{chunk-WK6DQSTW.mjs → chunk-W7WF42SC.mjs} +3 -3
  38. package/dist/{chunk-WK6DQSTW.mjs.map → chunk-W7WF42SC.mjs.map} +1 -1
  39. package/dist/{chunk-TLLVKBMP.mjs → chunk-ZDEVCYYC.mjs} +5 -5
  40. package/dist/{chunk-TLLVKBMP.mjs.map → chunk-ZDEVCYYC.mjs.map} +1 -1
  41. package/dist/{chunk-ZRQKYX2B.mjs → chunk-ZVXKXIPM.mjs} +40 -40
  42. package/dist/chunk-ZVXKXIPM.mjs.map +1 -0
  43. package/dist/dialog-body.js +2 -2
  44. package/dist/dialog-body.js.map +1 -1
  45. package/dist/dialog-body.mjs +3 -3
  46. package/dist/dialog-close-button.js +1 -1
  47. package/dist/dialog-close-button.js.map +1 -1
  48. package/dist/dialog-close-button.mjs +3 -3
  49. package/dist/dialog-footer.js +1 -1
  50. package/dist/dialog-footer.js.map +1 -1
  51. package/dist/dialog-footer.mjs +3 -3
  52. package/dist/dialog-header.js +1 -1
  53. package/dist/dialog-header.js.map +1 -1
  54. package/dist/dialog-header.mjs +3 -3
  55. package/dist/dialog-overlay.js +8 -8
  56. package/dist/dialog-overlay.js.map +1 -1
  57. package/dist/dialog-overlay.mjs +3 -3
  58. package/dist/dialog.d.mts +6 -6
  59. package/dist/dialog.d.ts +6 -6
  60. package/dist/dialog.js +97 -94
  61. package/dist/dialog.js.map +1 -1
  62. package/dist/dialog.mjs +18 -18
  63. package/dist/drawer-body.js +2 -2
  64. package/dist/drawer-body.js.map +1 -1
  65. package/dist/drawer-body.mjs +3 -3
  66. package/dist/drawer-close-button.js +1 -1
  67. package/dist/drawer-close-button.js.map +1 -1
  68. package/dist/drawer-close-button.mjs +3 -3
  69. package/dist/drawer-content.d.mts +1 -1
  70. package/dist/drawer-content.d.ts +1 -1
  71. package/dist/drawer-content.js +15 -15
  72. package/dist/drawer-content.js.map +1 -1
  73. package/dist/drawer-content.mjs +5 -5
  74. package/dist/drawer-drag-bar.js.map +1 -1
  75. package/dist/drawer-drag-bar.mjs +2 -2
  76. package/dist/drawer-footer.js +1 -1
  77. package/dist/drawer-footer.js.map +1 -1
  78. package/dist/drawer-footer.mjs +3 -3
  79. package/dist/drawer-header.js +1 -1
  80. package/dist/drawer-header.js.map +1 -1
  81. package/dist/drawer-header.mjs +3 -3
  82. package/dist/drawer-overlay.js +8 -8
  83. package/dist/drawer-overlay.js.map +1 -1
  84. package/dist/drawer-overlay.mjs +3 -3
  85. package/dist/drawer.d.mts +17 -17
  86. package/dist/drawer.d.ts +17 -17
  87. package/dist/drawer.js +104 -104
  88. package/dist/drawer.js.map +1 -1
  89. package/dist/drawer.mjs +12 -12
  90. package/dist/index.d.mts +16 -16
  91. package/dist/index.d.ts +16 -16
  92. package/dist/index.js +428 -419
  93. package/dist/index.js.map +1 -1
  94. package/dist/index.mjs +22 -22
  95. package/dist/modal-body.js +2 -2
  96. package/dist/modal-body.js.map +1 -1
  97. package/dist/modal-body.mjs +2 -2
  98. package/dist/modal-close-button.js +1 -1
  99. package/dist/modal-close-button.js.map +1 -1
  100. package/dist/modal-close-button.mjs +2 -2
  101. package/dist/modal-content.d.mts +1 -1
  102. package/dist/modal-content.d.ts +1 -1
  103. package/dist/modal-content.js +15 -15
  104. package/dist/modal-content.js.map +1 -1
  105. package/dist/modal-content.mjs +4 -4
  106. package/dist/modal-context.d.mts +3 -3
  107. package/dist/modal-context.d.ts +3 -3
  108. package/dist/modal-context.js.map +1 -1
  109. package/dist/modal-context.mjs +1 -1
  110. package/dist/modal-footer.js +1 -1
  111. package/dist/modal-footer.js.map +1 -1
  112. package/dist/modal-footer.mjs +2 -2
  113. package/dist/modal-header.js +1 -1
  114. package/dist/modal-header.js.map +1 -1
  115. package/dist/modal-header.mjs +2 -2
  116. package/dist/modal-overlay.js +8 -8
  117. package/dist/modal-overlay.js.map +1 -1
  118. package/dist/modal-overlay.mjs +2 -2
  119. package/dist/modal.d.mts +46 -46
  120. package/dist/modal.d.ts +46 -46
  121. package/dist/modal.js +71 -71
  122. package/dist/modal.js.map +1 -1
  123. package/dist/modal.mjs +11 -11
  124. package/package.json +10 -10
  125. package/dist/chunk-3BTHYYAS.mjs.map +0 -1
  126. package/dist/chunk-3K5JY6KM.mjs.map +0 -1
  127. package/dist/chunk-4J4ISPN7.mjs.map +0 -1
  128. package/dist/chunk-IIKFZB3M.mjs.map +0 -1
  129. package/dist/chunk-ZRQKYX2B.mjs.map +0 -1
  130. /package/dist/{chunk-BQAR3Q4F.mjs.map → chunk-LUSTM3GA.mjs.map} +0 -0
  131. /package/dist/{chunk-K4MJNSAV.mjs.map → chunk-OAECULYV.mjs.map} +0 -0
package/dist/dialog.js CHANGED
@@ -56,11 +56,11 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
56
56
  var import_jsx_runtime = require("react/jsx-runtime");
57
57
  var ModalBody = (0, import_core.forwardRef)(
58
58
  ({ className, __css, ...rest }, ref) => {
59
- const { styles, scrollBehavior } = useModal();
59
+ const { scrollBehavior, styles } = useModal();
60
60
  const css = {
61
+ alignItems: "flex-start",
61
62
  display: "flex",
62
63
  flexDirection: "column",
63
- alignItems: "flex-start",
64
64
  overflow: scrollBehavior === "inside" ? "auto" : void 0,
65
65
  ...__css ? __css : styles.body
66
66
  };
@@ -119,11 +119,11 @@ var ModalCloseButton = (0, import_core3.forwardRef)(
119
119
  {
120
120
  ref,
121
121
  className: (0, import_utils4.cx)("ui-modal__close-button"),
122
- __css: css,
123
122
  onClick: (0, import_utils4.handlerAll)(onClick, (ev) => {
124
123
  ev.stopPropagation();
125
124
  onClose == null ? void 0 : onClose();
126
125
  }),
126
+ __css: css,
127
127
  ...rest
128
128
  }
129
129
  );
@@ -164,8 +164,8 @@ var ModalFooter = (0, import_core5.forwardRef)(
164
164
  ({ className, __css, ...rest }, ref) => {
165
165
  const { styles } = useModal();
166
166
  const css = {
167
- display: "flex",
168
167
  alignItems: "center",
168
+ display: "flex",
169
169
  justifyContent: "flex-end",
170
170
  ...__css ? __css : styles.footer
171
171
  };
@@ -215,8 +215,8 @@ var ModalHeader = (0, import_core7.forwardRef)(
215
215
  ({ className, __css, ...rest }, ref) => {
216
216
  const { styles } = useModal();
217
217
  const css = {
218
- display: "flex",
219
218
  alignItems: "center",
219
+ display: "flex",
220
220
  justifyContent: "flex-start",
221
221
  ...__css ? __css : styles.header
222
222
  };
@@ -264,21 +264,21 @@ var import_transitions = require("@yamada-ui/transitions");
264
264
  var import_utils10 = require("@yamada-ui/utils");
265
265
  var import_jsx_runtime9 = require("react/jsx-runtime");
266
266
  var ModalOverlay = (0, import_motion.motionForwardRef)(
267
- ({ className, __css, onClick, ...rest }, ref) => {
267
+ ({ className, onClick, __css, ...rest }, ref) => {
268
268
  const {
269
- styles,
269
+ animation,
270
270
  closeOnOverlay,
271
- onOverlayClick,
271
+ duration,
272
+ styles,
272
273
  onClose,
273
- animation,
274
- duration
274
+ onOverlayClick
275
275
  } = useModal();
276
276
  const css = {
277
+ h: "100dvh",
278
+ left: 0,
277
279
  position: "fixed",
278
280
  top: 0,
279
- left: 0,
280
281
  w: "100vw",
281
- h: "100dvh",
282
282
  ...__css ? __css : styles.overlay
283
283
  };
284
284
  const props = animation !== "none" ? import_transitions.fadeProps : {};
@@ -288,11 +288,11 @@ var ModalOverlay = (0, import_motion.motionForwardRef)(
288
288
  ref,
289
289
  className: (0, import_utils10.cx)("ui-modal__overlay", className),
290
290
  custom: { duration },
291
- __css: css,
292
291
  onClick: (0, import_utils10.handlerAll)(onClick, onOverlayClick, (ev) => {
293
292
  ev.stopPropagation();
294
293
  if (closeOnOverlay) onClose == null ? void 0 : onClose();
295
294
  }),
295
+ __css: css,
296
296
  ...props,
297
297
  ...rest
298
298
  }
@@ -390,18 +390,18 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
390
390
  ({
391
391
  className,
392
392
  children,
393
- placement: _placement,
394
- withCloseButton,
395
- withDragBar,
396
393
  closeOnDrag,
397
394
  dragConstraints,
398
395
  dragElastic,
399
396
  dragOffset,
400
397
  dragVelocity,
398
+ placement: _placement,
399
+ withCloseButton,
400
+ withDragBar,
401
401
  blankForDragProps,
402
402
  ...rest
403
403
  }, ref) => {
404
- const { isOpen, onClose, duration } = useModal();
404
+ const { duration, isOpen, onClose } = useModal();
405
405
  const styles = useDrawer();
406
406
  const placement = (0, import_use_value.useValue)(_placement);
407
407
  const validChildren = (0, import_utils14.getValidChildren)(children);
@@ -420,27 +420,27 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
420
420
  let position = {};
421
421
  switch (placement) {
422
422
  case "top":
423
- position = { top: "calc(-100dvh + 1px)", left: 0, right: 0 };
423
+ position = { left: 0, right: 0, top: "calc(-100dvh + 1px)" };
424
424
  break;
425
425
  case "bottom":
426
426
  position = { bottom: "calc(-100dvh + 1px)", left: 0, right: 0 };
427
427
  break;
428
428
  case "left":
429
- position = { left: "calc(-100% + 1px)", top: 0, bottom: 0 };
429
+ position = { bottom: 0, left: "calc(-100% + 1px)", top: 0 };
430
430
  break;
431
431
  case "right":
432
- position = { right: "calc(-100% + 1px)", top: 0, bottom: 0 };
432
+ position = { bottom: 0, right: "calc(-100% + 1px)", top: 0 };
433
433
  break;
434
434
  }
435
435
  const [lightBg, darkBg] = blankForDragBg;
436
436
  return {
437
437
  _after: {
438
+ bg: lightBg,
438
439
  content: '""',
439
440
  display: "block",
440
- w: "100%",
441
441
  h: "100dvh",
442
- bg: lightBg,
443
442
  position: "absolute",
443
+ w: "100%",
444
444
  ...position,
445
445
  ...blankForDragProps
446
446
  },
@@ -506,18 +506,18 @@ var DrawerContent = (0, import_motion3.motionForwardRef)(
506
506
  {
507
507
  ref,
508
508
  className: (0, import_utils14.cx)("ui-drawer", className),
509
- isOpen,
510
- placement,
511
- duration,
512
509
  drag: closeOnDrag ? getDragDirection() : false,
513
510
  dragConstraints: getDragDirectionRestriction(dragConstraints),
514
511
  dragElastic: getDragDirectionRestriction(dragElastic),
515
- dragSnapToOrigin: true,
516
512
  dragMomentum: false,
513
+ dragSnapToOrigin: true,
514
+ duration,
515
+ isOpen,
516
+ placement,
517
+ tabIndex: -1,
517
518
  onDragEnd: (_, info) => {
518
519
  if (isCloseByDragInfo(info)) onClose == null ? void 0 : onClose();
519
520
  },
520
- tabIndex: -1,
521
521
  __css: css,
522
522
  ...rest,
523
523
  children: [
@@ -577,39 +577,39 @@ var getModalContentProps = (animation = "scale", duration) => {
577
577
  case "scale":
578
578
  return {
579
579
  ...import_transitions3.scaleFadeProps,
580
- custom: { scale: 0.95, reverse: true, duration }
580
+ custom: { duration, reverse: true, scale: 0.95 }
581
581
  };
582
582
  case "top":
583
583
  return {
584
584
  ...import_transitions3.slideFadeProps,
585
- custom: { offsetY: -16, reverse: true, duration }
585
+ custom: { duration, offsetY: -16, reverse: true }
586
586
  };
587
587
  case "right":
588
588
  return {
589
589
  ...import_transitions3.slideFadeProps,
590
- custom: { offsetX: 16, reverse: true, duration }
590
+ custom: { duration, offsetX: 16, reverse: true }
591
591
  };
592
592
  case "left":
593
593
  return {
594
594
  ...import_transitions3.slideFadeProps,
595
- custom: { offsetX: -16, reverse: true, duration }
595
+ custom: { duration, offsetX: -16, reverse: true }
596
596
  };
597
597
  case "bottom":
598
598
  return {
599
599
  ...import_transitions3.slideFadeProps,
600
- custom: { offsetY: 16, reverse: true, duration }
600
+ custom: { duration, offsetY: 16, reverse: true }
601
601
  };
602
602
  }
603
603
  };
604
604
  var ModalContent = (0, import_motion5.motionForwardRef)(
605
605
  ({ className, children, __css, ...rest }, ref) => {
606
606
  const {
607
- styles,
607
+ animation,
608
+ duration,
608
609
  scrollBehavior,
610
+ styles,
609
611
  withCloseButton,
610
- onClose,
611
- animation,
612
- duration
612
+ onClose
613
613
  } = useModal();
614
614
  const validChildren = (0, import_utils16.getValidChildren)(children);
615
615
  const [customModalCloseButton, ...cloneChildren] = (0, import_utils16.findChildren)(
@@ -619,21 +619,21 @@ var ModalContent = (0, import_motion5.motionForwardRef)(
619
619
  );
620
620
  const props = animation !== "none" ? getModalContentProps(animation, duration) : {};
621
621
  const css = {
622
- position: "relative",
623
- maxH: "100%",
624
622
  display: "flex",
625
623
  flexDirection: "column",
626
- overflow: scrollBehavior === "inside" ? "hidden" : "auto",
624
+ maxH: "100%",
627
625
  outline: 0,
626
+ overflow: scrollBehavior === "inside" ? "hidden" : "auto",
627
+ position: "relative",
628
628
  ...__css ? __css : styles.container
629
629
  };
630
630
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
631
631
  import_motion5.motion.section,
632
632
  {
633
- role: "dialog",
634
- "aria-modal": "true",
635
633
  ref,
636
634
  className: (0, import_utils16.cx)("ui-modal", className),
635
+ "aria-modal": "true",
636
+ role: "dialog",
637
637
  tabIndex: -1,
638
638
  __css: css,
639
639
  ...props,
@@ -659,30 +659,30 @@ var Modal = (0, import_motion6.motionForwardRef)(
659
659
  });
660
660
  const {
661
661
  className,
662
- children,
663
- isOpen,
664
- onClose,
665
- onOverlayClick,
666
- onEsc,
667
- onCloseComplete,
668
- placement: _placement = "center",
669
- outside = "fallback(4, 1rem)",
670
- withCloseButton = true,
671
- withOverlay = true,
672
662
  allowPinchZoom = false,
673
- scrollBehavior = "inside",
663
+ animation = "scale",
674
664
  autoFocus,
675
- restoreFocus,
676
- initialFocusRef,
677
- finalFocusRef,
678
665
  blockScrollOnMount = true,
679
- closeOnOverlay = true,
666
+ children,
680
667
  closeOnEsc = true,
681
- lockFocusAcrossFrames = true,
682
- animation = "scale",
668
+ closeOnOverlay = true,
683
669
  duration,
684
- portalProps,
670
+ finalFocusRef,
671
+ initialFocusRef,
672
+ isOpen,
673
+ lockFocusAcrossFrames = true,
674
+ outside = "fallback(4, 1rem)",
675
+ placement: _placement = "center",
676
+ restoreFocus,
677
+ scrollBehavior = "inside",
678
+ withCloseButton = true,
679
+ withOverlay = true,
685
680
  containerProps,
681
+ portalProps,
682
+ onClose,
683
+ onCloseComplete,
684
+ onEsc,
685
+ onOverlayClick,
686
686
  ...rest
687
687
  } = (0, import_core12.omitThemeProps)(mergedProps);
688
688
  const onKeyDown = (0, import_react2.useCallback)(
@@ -706,39 +706,39 @@ var Modal = (0, import_motion6.motionForwardRef)(
706
706
  drawerContent = (0, import_react2.cloneElement)(drawerContent, { onKeyDown });
707
707
  const placement = (0, import_use_value2.useValue)(_placement);
708
708
  const css = {
709
+ alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center",
710
+ display: "flex",
711
+ h: "100dvh",
712
+ justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
713
+ left: 0,
714
+ p: size !== "full" ? outside : void 0,
709
715
  position: "fixed",
710
716
  top: 0,
711
- left: 0,
712
- zIndex: "fallback(jeice, 110)",
713
717
  w: "100vw",
714
- h: "100dvh",
715
- p: size !== "full" ? outside : void 0,
716
- display: "flex",
717
- justifyContent: placement.includes("left") ? "flex-start" : placement.includes("right") ? "flex-end" : "center",
718
- alignItems: placement.includes("top") ? "flex-start" : placement.includes("bottom") ? "flex-end" : "center"
718
+ zIndex: "fallback(jeice, 110)"
719
719
  };
720
720
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
721
721
  ModalProvider,
722
722
  {
723
723
  value: {
724
- isOpen,
725
- onClose,
726
- onOverlayClick,
727
- withCloseButton,
728
- scrollBehavior,
729
- closeOnOverlay,
730
724
  animation,
725
+ closeOnOverlay,
731
726
  duration,
732
- styles
727
+ isOpen,
728
+ scrollBehavior,
729
+ styles,
730
+ withCloseButton,
731
+ onClose,
732
+ onOverlayClick
733
733
  },
734
734
  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)(
735
735
  import_focus_lock.FocusLock,
736
736
  {
737
737
  autoFocus,
738
- initialFocusRef,
739
738
  finalFocusRef,
740
- restoreFocus,
739
+ initialFocusRef,
741
740
  lockFocusAcrossFrames,
741
+ restoreFocus,
742
742
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
743
743
  import_react_remove_scroll.RemoveScroll,
744
744
  {
@@ -777,19 +777,19 @@ var Dialog = (0, import_motion7.motionForwardRef)(
777
777
  });
778
778
  const {
779
779
  className,
780
+ cancel,
780
781
  children,
781
- withOverlay = true,
782
- withCloseButton = true,
783
- header,
784
782
  footer,
785
- cancel,
783
+ header,
786
784
  other,
787
785
  success,
788
- onClose,
786
+ withCloseButton = true,
787
+ withOverlay = true,
788
+ containerProps,
789
789
  onCancel,
790
+ onClose,
790
791
  onOther,
791
792
  onSuccess,
792
- containerProps,
793
793
  ...rest
794
794
  } = (0, import_core13.omitThemeProps)(mergedProps);
795
795
  const validChildren = (0, import_utils18.getValidChildren)(children);
@@ -807,15 +807,18 @@ var Dialog = (0, import_motion7.motionForwardRef)(
807
807
  DialogFooter
808
808
  ) : children;
809
809
  const css = { ...styles.container };
810
- const cancelButtonProps = (0, import_utils18.isValidElement)(cancel) ? { children: cancel } : cancel;
811
- const otherButtonProps = (0, import_utils18.isValidElement)(other) ? { children: other } : other;
812
- const successButtonProps = (0, import_utils18.isValidElement)(success) ? { children: success } : success;
813
- if (cancelButtonProps && !cancelButtonProps.variant)
814
- cancelButtonProps.variant = "ghost";
815
- if (otherButtonProps && !otherButtonProps.colorScheme)
810
+ const cancelButtonProps = (0, import_utils18.isValidElement)(cancel) || (0, import_utils18.isUndefined)(cancel) ? { children: cancel } : cancel;
811
+ const otherButtonProps = (0, import_utils18.isValidElement)(other) || (0, import_utils18.isUndefined)(other) ? { children: other } : other;
812
+ const successButtonProps = (0, import_utils18.isValidElement)(success) || (0, import_utils18.isUndefined)(success) ? { children: success } : success;
813
+ if (!cancelButtonProps.variant) cancelButtonProps.variant = "ghost";
814
+ if (!otherButtonProps.colorScheme)
816
815
  otherButtonProps.colorScheme = "secondary";
817
- if (successButtonProps && !successButtonProps.colorScheme)
816
+ if (!successButtonProps.colorScheme)
818
817
  successButtonProps.colorScheme = "primary";
818
+ const hasCancelButton = !!cancelButtonProps.children;
819
+ const hasOtherButton = !!otherButtonProps.children;
820
+ const hasSuccessButton = !!successButtonProps.children;
821
+ const hasFooter = hasCancelButton || hasOtherButton || hasSuccessButton;
819
822
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
820
823
  Modal,
821
824
  {
@@ -823,10 +826,10 @@ var Dialog = (0, import_motion7.motionForwardRef)(
823
826
  className: (0, import_utils18.cx)("ui-dialog", className),
824
827
  __css: css,
825
828
  ...{
826
- onClose,
827
- withOverlay: false,
828
829
  withCloseButton: false,
830
+ withOverlay: false,
829
831
  containerProps,
832
+ onClose,
830
833
  ...rest,
831
834
  size
832
835
  },
@@ -835,22 +838,22 @@ var Dialog = (0, import_motion7.motionForwardRef)(
835
838
  customDialogCloseButton != null ? customDialogCloseButton : withCloseButton && onClose ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogCloseButton, {}) : null,
836
839
  customDialogHeader != null ? customDialogHeader : header ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogHeader, { children: header }) : null,
837
840
  customDialogBody != null ? customDialogBody : cloneChildren ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogBody, { children: cloneChildren }) : null,
838
- 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: [
839
- cancelButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
841
+ customDialogFooter != null ? customDialogFooter : footer || hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogFooter, { children: footer != null ? footer : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
842
+ hasCancelButton ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
840
843
  import_button.Button,
841
844
  {
842
845
  onClick: () => onCancel == null ? void 0 : onCancel(onClose),
843
846
  ...cancelButtonProps
844
847
  }
845
848
  ) : null,
846
- otherButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
849
+ hasOtherButton ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
847
850
  import_button.Button,
848
851
  {
849
852
  onClick: () => onOther == null ? void 0 : onOther(onClose),
850
853
  ...otherButtonProps
851
854
  }
852
855
  ) : null,
853
- successButtonProps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
856
+ hasSuccessButton ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
854
857
  import_button.Button,
855
858
  {
856
859
  onClick: () => onSuccess == null ? void 0 : onSuccess(onClose),