@sustaina/shared-ui 1.57.0 → 1.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -9911,7 +9911,7 @@ function DialogHeader2({ className, children, ...props }) {
9911
9911
  SheetPrimitive.Close,
9912
9912
  {
9913
9913
  "data-slot": "dialog-close",
9914
- className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
9914
+ className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
9915
9915
  children: [
9916
9916
  /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
9917
9917
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
@@ -10123,18 +10123,37 @@ function DialogAlert({
10123
10123
  func?.();
10124
10124
  onOpenChange(false);
10125
10125
  }, [onCancel, onConfirm, onOpenChange, showCancel, variant]);
10126
+ const handleOpenChange = useCallback(
10127
+ (state) => {
10128
+ if (!state) {
10129
+ onCancel?.();
10130
+ }
10131
+ onOpenChange(state);
10132
+ },
10133
+ [onCancel, onOpenChange]
10134
+ );
10126
10135
  return /* @__PURE__ */ jsx(Dialog3, { open, onOpenChange: persistent ? () => {
10127
- } : onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent3, { className: "max-w-md", showCloseButton: !persistent, children: [
10128
- /* @__PURE__ */ jsxs(DialogHeader3, { children: [
10129
- title && /* @__PURE__ */ jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10130
- description && /* @__PURE__ */ jsx(DialogDescription3, { children: t(description) })
10131
- ] }),
10132
- outlet && outlet,
10133
- /* @__PURE__ */ jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10134
- showCancel && /* @__PURE__ */ jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10135
- confirmText && /* @__PURE__ */ jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10136
- ] })
10137
- ] }) });
10136
+ } : handleOpenChange, children: /* @__PURE__ */ jsxs(
10137
+ DialogContent3,
10138
+ {
10139
+ className: "max-w-md",
10140
+ showCloseButton: !persistent,
10141
+ onInteractOutside: (e) => {
10142
+ e.preventDefault();
10143
+ },
10144
+ children: [
10145
+ /* @__PURE__ */ jsxs(DialogHeader3, { children: [
10146
+ title && /* @__PURE__ */ jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10147
+ description && /* @__PURE__ */ jsx(DialogDescription3, { children: t(description) })
10148
+ ] }),
10149
+ outlet && outlet,
10150
+ /* @__PURE__ */ jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10151
+ showCancel && /* @__PURE__ */ jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10152
+ confirmText && /* @__PURE__ */ jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10153
+ ] })
10154
+ ]
10155
+ }
10156
+ ) });
10138
10157
  }
10139
10158
 
10140
10159
  // src/components/dialog-alert/templates/index.ts